Cargando…

Functional Kotlin : Extend your OOP skills and implement Functional techniques in Kotlin and Arrow.

Nowadays, writing side effects free programs is very critical. As requirements are becoming complex day by day, Functional Programming can help us in this situation. This book will not only help you learn basics of Functional Programming with Kotlin, but will also show you how to apply them to real-...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Arias, Mario
Otros Autores: Chakraborty, Rivu
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing, 2018.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Title Page; Copyright and Credits; Dedication; Packt Upsell; Contributors; Table of Contents; Preface; Chapter 1: Kotlin â#x80;#x93; Data Types, Objects, and Classes; Classes; Properties; Methods; Inheritance; Abstract classes; Interfaces; Objects; Object declarations; Companion objects; Generics; Type alias; Nullable types; Checking for null; Checking for non-null types; Safe calls; The Elvis (?:) operator; The (!!) operator; Kotlin's type system; The Any type; Minimum common types; The Unit type; The Nothing type; Other types; Data classes; Canonical methods; The copy() method.
  • Destructuring methodsAnnotations; Enum; Summary; Chapter 2: Getting Started with Functional Programming; What is functional programming?; Basics concepts; First-class and higher-order functions; Pure functions; Recursive functions; Lazy evaluation; Functional collections; Implementing a functional list; Summary; Chapter 3: Immutability
  • It's Important; What is immutability?; Implementing immutability in Kotlin; The difference between var and val; Compile time constants; Types of immutability; Immutable reference (referential immutability); Immutable values; Immutable collections.
  • The advantages of immutabilityThread safety; Low coupling; Referential transparency; Failure atomicity; Caching; Compiler optimization; Pure functions; The disadvantages of immutability; Summary; Chapter 4: Functions, Function Types, and Side Effects; Functions in Kotlin; Returning two values from a function; Extension functions; Default arguments; Nested functions; Function types in functional programming; Lambda; Function as property; High order functions; Pure functions and side effects; Side effects; Pure functions; Summary; Chapter 5: More on Functions; Single-expression functions.
  • Parametersvararg; Lambda; Named parameters; Named parameters on high-order functions; Default parameters; Extension functions; Extension functions and inheritance; Extension functions as members; Extension functions with conflicting names; Extension functions for objects; Infix functions; Operator overloading; Binary operators; Invoke; Indexed access; Unary operators; Type-safe builders; Creating a DSL; Inline functions; Inline restrictions; Recursion and corecursion; Summary; Chapter 6: Delegates in Kotlin; Introduction to delegation; Understanding delegation; Delegates in Kotlin.
  • Property delegation (standard delegates)The Delegates.notNull function and lateinit; The lazy function; Observing property value change with Delegates. Observable; The power of veto â#x80;#x93; Delegates.vetoable; Delegated map; Custom delegation; Local delegates; Class delegation; Summary; Chapter 7: Asynchronous Programming with Coroutines; Introduction to coroutines; Understanding JVM threads; Hello, coroutine world!; Using coroutines in real life; Synchronous implementation; Callbacks; Java Futures; Promises with Kovenant ; Coroutines; Coroutine context; Channels; Channel pipelines.