Functional Kotlin

Learn how to apply Functional Programming with Kotlin to real-life projects with popular libraries like Arrow.
Preview in Mapt

Functional Kotlin

Mario Arias, Rivu Chakraborty

Learn how to apply Functional Programming with Kotlin to real-life projects with popular libraries like Arrow.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99 p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Functional Kotlin Book Cover
Functional Kotlin
$ 39.99
$ 28.00
Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 25.20
Buy 2 for $35.00
Save $40.98
Add to Cart

Book Details

ISBN 139781788476485
Paperback350 pages

Book Description

Functional programming makes your application faster, improves performance, and increases your productivity. Kotlin supports many of the popular and advanced functional features of functional languages. This book will cover the A-Z of functional programming in Kotlin. This book bridges the language gap for Kotlin developers by showing you how to create and consume functional constructs in Kotlin. We also bridge the domain gap by showing how functional constructs can be applied in business scenarios. We’ll take you through lambdas, pattern matching, immutability, and help you develop a deep understanding of the concepts and practices of functional programming. If you want learn to address problems using Recursion, Koltin has support for it as well. You’ll also learn how to use the funKtionale library to perform currying and lazy programming and more. Finally, you’ll learn functional design patterns and techniques that will make you a better programmer.By the end of the book, you will be more confident in your functional programming skills and will be able to apply them while programming in Kotlin.

Table of Contents

Chapter 1: Kotlin – Data Types, Objects, and Classes
Classes
Inheritance
Abstract classes
Interfaces
Objects
Generics
Type alias
Nullable types
Kotlin's type system
Other types
Summary
Chapter 2: Getting Started with Functional Programming
What is functional programming?
Basics concepts
Functional collections
Implementing a functional list
Summary
Chapter 3: Immutability - It's Important
What is immutability?
Immutable collections
The advantages of immutability
The disadvantages of immutability
Summary
Chapter 4: Functions, Function Types, and Side Effects
Functions in Kotlin
Function types in functional programming
Lambda
High order functions
Pure functions and side effects
Summary
Chapter 5: More on Functions
Single-expression functions
Parameters
Extension functions
Infix functions
Operator overloading
Type-safe builders
Inline functions
Recursion and corecursion
Summary
Chapter 6: Delegates in Kotlin
Introduction to delegation
Delegates in Kotlin
Property delegation (standard delegates)
Delegated map
Custom delegation
Local delegates
Class delegation
Summary
Chapter 7: Asynchronous Programming with Coroutines
Introduction to coroutines
Using coroutines in real life
Channels
Managing mutable state
Summary
Chapter 8: Collections and Data Operations in Kotlin
An introduction to collections
List and MutableList
Set and MutableSet
Map and MutableMap
Data operations in a collection
Grouping collections
Summary
Chapter 9: Functional Programming and Reactive Programming
Combining FP with OOP
Functional reactive programming
Getting started with RxKotlin
Observables
The Observable.create method
The Observable.from methods
Iterator<T>.toObservable
Subscriber – the Observer interface
Subscribing and disposing
Summary
Chapter 10: Functors, Applicatives, and Monads
Functors   
Monads
Applicatives
Summary
Chapter 11: Working with Streams in Kotlin
Introduction to Streams
Collections versus Streams
Working with Streams
Primitive streams
Stream factory methods
Collector and Stream.collect – collecting Streams
Summary
Chapter 12: Getting Started with Arrow
Function composition
Partial application
Reverse
Pipes
Currying
Logical complement
Memoization
Partial functions
Identity and constant
Optics
Summary
Chapter 13: Arrow Types
Option
Arrow's type hierarchy
Either
Monad transformers
Try
State
Summary
Chapter 14: Kotlin's Quick Start
Writing and running Kotlin
Basic Kotlin syntax
Going further

What You Will Learn

  • Learn the Concepts of Functional Programming with Kotlin
  • Discover the Coroutines in Kotlin
  • Uncover Using funkTionale plugin
  • Learn Monads, Functiors and Applicatives
  • Combine Functional Programming with OOP and Reactive Programming
  • Uncover Using Monads with funkTionale
  • Discover Stream Processing

Authors

Table of Contents

Chapter 1: Kotlin – Data Types, Objects, and Classes
Classes
Inheritance
Abstract classes
Interfaces
Objects
Generics
Type alias
Nullable types
Kotlin's type system
Other types
Summary
Chapter 2: Getting Started with Functional Programming
What is functional programming?
Basics concepts
Functional collections
Implementing a functional list
Summary
Chapter 3: Immutability - It's Important
What is immutability?
Immutable collections
The advantages of immutability
The disadvantages of immutability
Summary
Chapter 4: Functions, Function Types, and Side Effects
Functions in Kotlin
Function types in functional programming
Lambda
High order functions
Pure functions and side effects
Summary
Chapter 5: More on Functions
Single-expression functions
Parameters
Extension functions
Infix functions
Operator overloading
Type-safe builders
Inline functions
Recursion and corecursion
Summary
Chapter 6: Delegates in Kotlin
Introduction to delegation
Delegates in Kotlin
Property delegation (standard delegates)
Delegated map
Custom delegation
Local delegates
Class delegation
Summary
Chapter 7: Asynchronous Programming with Coroutines
Introduction to coroutines
Using coroutines in real life
Channels
Managing mutable state
Summary
Chapter 8: Collections and Data Operations in Kotlin
An introduction to collections
List and MutableList
Set and MutableSet
Map and MutableMap
Data operations in a collection
Grouping collections
Summary
Chapter 9: Functional Programming and Reactive Programming
Combining FP with OOP
Functional reactive programming
Getting started with RxKotlin
Observables
The Observable.create method
The Observable.from methods
Iterator<T>.toObservable
Subscriber – the Observer interface
Subscribing and disposing
Summary
Chapter 10: Functors, Applicatives, and Monads
Functors   
Monads
Applicatives
Summary
Chapter 11: Working with Streams in Kotlin
Introduction to Streams
Collections versus Streams
Working with Streams
Primitive streams
Stream factory methods
Collector and Stream.collect – collecting Streams
Summary
Chapter 12: Getting Started with Arrow
Function composition
Partial application
Reverse
Pipes
Currying
Logical complement
Memoization
Partial functions
Identity and constant
Optics
Summary
Chapter 13: Arrow Types
Option
Arrow's type hierarchy
Either
Monad transformers
Try
State
Summary
Chapter 14: Kotlin's Quick Start
Writing and running Kotlin
Basic Kotlin syntax
Going further

Book Details

ISBN 139781788476485
Paperback350 pages
Read More

Read More Reviews

Recommended for You

Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 25.20
Learning Concurrency in Kotlin Book Cover
Learning Concurrency in Kotlin
$ 35.99
$ 25.20
Hands On Functional Kotlin [Video] Book Cover
Hands On Functional Kotlin [Video]
$ 124.99
$ 106.25
Building Applications with Spring 5 and Kotlin Book Cover
Building Applications with Spring 5 and Kotlin
$ 35.99
$ 25.20
Getting Started with Reactive Programming with Kotlin [Video] Book Cover
Getting Started with Reactive Programming with Kotlin [Video]
$ 124.99
$ 106.25
Applied Kotlin for Android Application Development [Video] Book Cover
Applied Kotlin for Android Application Development [Video]
$ 124.99
$ 106.25