Skip to product information
Learning Functional Programming with Kotlin
Learning Functional Programming with Kotlin
Description
Book Introduction
Using the next-generation language Kotlin
Design functional code that can be used in real-world situations!

This book faithfully explains functional concepts, which can be perceived as difficult, so that they can become knowledge that can be applied in real life.
It provides a variety of exemplary examples and practical application problems that allow you to immediately apply what you have learned, allowing you to acquire functional programming skills.
This book covers functional programming using Kotlin, a multi-paradigm language.
Therefore, it also covers the trial and error and coping strategies when doing functional programming in a language that is not purely functional, which will be of great practical help considering that purely functional languages ​​are rarely used in practice.

Kotlin is designed to support object-oriented programming along with functional features, so we compared imperative, object-oriented, and functional examples as needed.
In addition, it is structured so that you can go beyond simply using the functional features provided by the language and create higher-order functions, functional data structures, types, etc., so you will be able to advance to the level of being able to create and provide a functional library.

index
Chapter 1 What is Functional Programming?

1.1 Features of functional programming
1.2 What is a pure function?
____Same input, same output
____Code without side effects
____The Effects of Pure Functions and Other Considerations
1.3 Writing a program without side effects
____Side effects of modifying shared variables
Side effects due to changes in the state of ____objects
1.4 Making Programs Safer with Referential Transparency
____Reference non-transparent function
____Reference transparent function
1.5 What is a first-class function?
____first-class object
____first-class function
1.6 Increasing abstraction and reusability using first-class functions
____Simple calculator example
____An example of an object-oriented improved calculator
____Example of a calculator improved with functional programming
1.7 Creating an Infinite Data Structure with Lazy Evaluation
____Store infinity values ​​in a data structure
1.8 In conclusion
____Getting Started with Functional Programming in Kotlin

Chapter 2

2.1 Property Declaration and Safe Null Handling
____Property Declaration
____Safe Null Processing
2.2 Functions and Lambdas
____Various ways to declare a function
Setting default values ​​for ____parameters
____Anonymous functions and lambda expressions
____extension function
2.3 Control statements
____if statement
____when statement
____for statement
2.4 Interface
Features of the ____interface
Declare and inherit an interface ____
____Declaring abstract functions in an interface
Implementing an abstract function
____Declaration and use of abstract properties
2.5 class
____classes and properties
____data class
____enum class
____sealed class
2.6 Pattern Matching
____How to define various patterns
Pattern matching based on ____ conditions
____Limitations of Kotlin Pattern Matching
2.7 Object Decomposition
2.8 Collection
____lists and sets
____map
2.9 Generics
____Generic function declaration
2.10 Kotlin Standard Library
____let function
____with function
____run function
____apply function
____also function
Comparison of ____let, with, run, apply, and also functions
____use function
2.11 Transformation
Meaning and examples of ____invariance
Meaning and examples of ____covariance
____Meaning and examples of contravariance
Declare transformation as ____in, out
2.12 In conclusion

Chapter 3 Recursion

3.1 The meaning of recursion in functional programming
____An example of implementing the Fibonacci sequence using imperative programming
____An example of implementing the Fibonacci sequence recursively
____Recursion in functional programming
3.2 How to design recursion
____How to design a recursive function
____Observe the flow in which recursion is performed
Implementing code using the ____recursive function design method
3.3 Getting familiar with recursion
____reverse function example
____take function example
____repeat function example
____zip function example
3.4 Improving Performance with Memoization
____Recursive Fibonacci Sequence Example
____Fibonacci sequence example using memoization
____Solving the problem of recursion functionally
3.5 Optimizing with Tail Recursion
____What is tail recursion optimization?
Rewrite the ____maximum function as tail recursive
Rewrite the ____reverse function as tail recursion
Rewrite the ____take function as tail recursive
Rewriting the ____zip function as tail recursive
3.6 Optimizing Mutual Recursion with Tail Recursion
____mutual recursion
____trampoline
3.7 Practical Applications
Function to find the power set of ____
3.8 In conclusion

Chapter 4 Higher-Order Functions

4.1 What is a higher-order function?
____Example of satisfying higher-order function conditions
____Increases code reusability
____It is easy to extend the function
____You can write concise code
4.2 Partial functions
Example of a ____partial function
Creating a ____partial function
The need for ____partial functions
4.3 Partial application function
4.4 Currying functions
____Abstracting currying functions for Kotlin
4.5 Composition functions
Generalizing function composition
____point freestyle programming
____Composition of functions that take one or more parameters
4.6 Practical Applications
____zipWith function
____Replacing callback listeners with higher-order functions
4.7 In conclusion

Chapter 5: Handling Data with Collections

5.1 Data Processing in Functional Collections
____Creating a simple list data structure
Create a ____addHead function
Creating the ____appendTail function
____Time complexity of appendTail function written using tail recursion
Create a ____getTail function
5.2 Filtering Collection Data
____Imperative vs.
Functional approach
Create a ____filter function
5.3 Changing Collection Data
____Imperative vs.
Functional approach
Creating a ____map function
5.4 Reducing collection data step by step
Create a ____foldLeft function
Using the ____foldLeft function
Writing the toUpper function using the ____foldLeft function
Create a ____foldRight function
____foldLeft vs.
foldRight
5.5 Merging data from multiple collections
Creating a ____zipWith function
5.6 Comparing Imperative and Functional Approaches Using Kotlin Lists
____Comparison of features between imperative and functional approaches
____Performance comparison of imperative and functional methods
5.7 Lazy Collection FunStream
____FunList vs.
Comparison of FunStream declaration methods
____FunList vs.
FunStream Performance Comparison
____Creating infinite values ​​with FunStream
5.8 Practical Applications
Add the printFunList function to ____FunList
5.9 In conclusion

Chapter 6 Functional Type System

6.1 Type System
Types and characteristics of ____type systems
____Static type system of functional languages
6.2 Algebraic data types
Examples and limitations of the ____ product type
OR combination using ____sum type
____Algebraic data types in functional programming
6.3 Type Components
____type variable
____value constructor
____type constructor and type parameters
6.4 Defining Types with Behaviors
____Interface vs.
Trait vs.
Abstract Class vs.
mix-in
Declaring ____type classes and instances of type classes
6.5 Recursive Data Structures
6.6 Practical Applications
____Advantages of algebraic sum type
6.7 In conclusion

Chapter 7 Functors

7.1 What is a functor?
Declaring a ____functor
7.2 Creating a Maybe Functor
7.3 Creating a Tree Functor
7.4 Creating an Ether Functor
7.5 Creating a unary function functor
7.6 Functor's Law
____Functor's First Law
____Functor's Second Law
____An example of a functor instance that does not satisfy the laws of functors
7.7 Practical Applications
Mapping to a function with one or more ____parameters
7.8 In conclusion

Chapter 8 Applicative Functors
8.1 What is an Applicative Functor?
____Definition of an applicative functor
____Applicative Functor Type Class
8.2 Creating a Maybe Applicative Functor
____Let's try using the maybe-applicative functor
____Applicative Style
Creating a Maybe Applicable Functor Using ____Extension Functions
8.3 Creating a Tree Applicative Functor
____Creating a general tree functor
____Extending with Applicative Functors
8.4 Creating an Ether Applicative Functor
8.5 The Law of Applicative Functors
____Identity Law
____Composition Law
____Law of Homomorphism
____Law of Interchange
The relationship between ____functors and applicative functors
8.6 Practical Applications
Create a ____liftA2 function
Create a function ____sequenceA
8.7 In conclusion

Chapter 9 Monoid

9.1 What is a monoid?
9.2 Monoid Type Class
____Simple monoid type class declaration
____The Law of the Monoid
Creating a ____mconcat function
9.3 Creating a Maybe Monoid
____Verify Maybe Monoid
9.4 Creating a foldMap function for a foldable binary tree
____foldMap function
____Creating a foldable binary tree
9.5 Practical Applications
____Check if a specific value exists within a binary tree
Converting a binary tree to a list using ____foldMap
9.6 In conclusion

Chapter 10 Monads

10.1 Monad type class
10.2 Maybe Monad
____Maybe using monads
10.3 Monad Law
____Left identity law
____right identity law
____associativity law
____Monad law from the perspective of function composition
10.4 IO Monad
____An example where input/output operations are not separated from the outside world
____An example of input/output operations being separated from the outside world
10.5 List Monad
____Declaring the basic skeleton of FunList
____Creating a list creation function and an output function
____Make a list monoid
Implementing the ____fmap function
Implementing the ____pure and apply functions
Implementing the ____flatMap function
10.6 Practical Applications
Create a ____list
____Create a list of tuples of all combinations of two lists
Convert the characters in the ____ list to uppercase
Applying a function to values ​​in a list ____
____Remove duplicate characters
____Flipping list elements
10.7 In conclusion

Chapter 11: Logging, Exception Handling, Testing, and Debugging

11.1 Logging in Functional Programming
Logging in imperative programming
Logging in functional programming
____Improving using extension functions
Creating a ____writer monad
11.2 Handling Exceptions in Functional Programming
Exception handling using ____null value or -1
Exception handling using the ____Maybe monad
Exception Handling Using the ____Ether Monad
Exception handling using the ____tri monad
11.3 Testing in Functional Programming
____Creating testable code
____Testing pure functions
____Testing functions with side effects
11.4 Debugging in Functional Programming
____Debugging Tips and Tools
Debugging List Chains Using IntelliJ
____Debugging Sequence Chains Using IntelliJ
11.5 In conclusion
GOODS SPECIFICS
- Publication date: December 20, 2019
- Page count, weight, size: 328 pages | 188*240*30mm
- ISBN13: 9788966262557
- ISBN10: 8966262554

You may also like

카테고리