Leanpub Header

Skip to main content

Functional Kotlin

Functional Kotlin

The instructor is letting you choose the price you pay for this course!

Pick Your Price...
About

About

About the Course

Price

Course Price

Minimum price

$25.00

$35.00

You pay

$35.00

Author earns

$28.00
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 1)

1
The author will earn $48.00 from your purchase!
You can get credits monthly with a Reader Membership

Instructor

About the Instructor

Marcin Moskała

Marcin Moskala is an experienced developer and Kotlin trainer. He is the founder of the kt.academy, Kotlin GDE, an official JetBrains partner for teaching Kotlin, and author of the books Effective Kotlin, Kotlin Coroutines, and Android Development with Kotlin.

Leanpub Podcast

Episode 254

An Interview with Marcin Moskała

Material

Course Material

  • Notes about the course

  • Project with exercises

  • Quiz 1

    3 attempts allowed

  • Introduction to functional programming with Kotlin

  • Why do we need to use functions as objects?

  • Function types

  • Defining function types

  • Using function types

  • Named parameters

  • Type aliases

  • A function type is an interface

  • Quiz 2

    3 attempts allowed

  • Anonymous functions

  • Quiz 3

    3 attempts allowed

  • Lambda expressions

  • Tricky braces

  • Parameters

  • Trailing lambdas

  • Result values

  • Lambda expression examples

  • An implicit name for a single parameter

  • Closures

  • Lambda expressions vs anonymous functions

  • Quiz 4

    3 attempts allowed

  • Exercise: Function types and literals

  • Quiz 5

    100 attempts allowed

  • Exercise: Observable value

  • Quiz 6

    100 attempts allowed

  • Function references

  • Top-level functions references

  • Method references

  • Extension function references

  • Method references and generic types

  • Bounded function references

  • Constructor references

  • Bounded object declaration references

  • Function overloading and references

  • Property references

  • Quiz 7

    3 attempts allowed

  • Exercise: Inferred function types

  • Quiz 8

    100 attempts allowed

  • Exercise: Function references

  • Quiz 9

    100 attempts allowed

  • SAM Interface support in Kotlin

  • Support for Java SAM interfaces in Kotlin

  • Functional interfaces

  • Quiz 10

    3 attempts allowed

  • Inline functions

  • Inline functions

  • Inline functions with functional parameters

  • Non-local return

  • Crossinline and noinline

  • Reified type parameters

  • Inline properties

  • Costs of the inline modifier

  • Using inline functions

  • Quiz 11

    3 attempts allowed

  • Exercise: Inline functions

  • Quiz 12

    100 attempts allowed

  • Collection processing

  • forEach and onEach

  • filter

  • map

  • mapNotNull

  • flatMap

  • Quiz 13

    3 attempts allowed

  • Exercise: Implement map

  • Quiz 14

    100 attempts allowed

  • Exercise: Optimize collection processing

  • Quiz 15

    100 attempts allowed

  • fold

  • fold

  • reduce

  • sum

  • Quiz 16

    3 attempts allowed

  • withIndex and indexed variants

  • withIndex and indexed variants

  • Quiz 17

    3 attempts allowed

  • take, takeLast, drop, dropLast and subList

  • take, takeLast, drop, dropLast and subList

  • Quiz 18

    3 attempts allowed

  • Exercise: Adding element at position

  • Quiz 19

    100 attempts allowed

  • Getting elements at certain positions

  • Getting elements at certain positions

  • Finding an element

  • Counting elements

  • any, all and none

  • Quiz 20

    3 attempts allowed

  • Exercise: Implement shop functions

  • Quiz 21

    100 attempts allowed

  • partition

  • partition

  • groupBy

  • Quiz 22

    3 attempts allowed

  • Associating to a map

  • Associating to a map

  • distinct and distinctBy

  • Quiz 23

    3 attempts allowed

  • Exercise: Prime access list

  • Quiz 24

    100 attempts allowed

  • Sorting: sorted, sortedBy and sortedWith

  • Sorting: sorted, sortedBy and sortedWith

  • Sorting mutable collections

  • Maximum and minimum

  • shuffled and random

  • Quiz 25

    3 attempts allowed

  • Exercise: Top articles

  • Quiz 26

    100 attempts allowed

  • Exercise: Refactor collection processing

  • Quiz 27

    100 attempts allowed

  • zip and zipWithNext

  • zip and zipWithNext

  • Windowing

  • Quiz 28

    3 attempts allowed

  • joinToString

  • joinToString

  • Map, Set and String processing

  • Quiz 29

    3 attempts allowed

  • Exercise: Passing students list

  • Quiz 30

    100 attempts allowed

  • Exercise: Best students list

  • Quiz 31

    100 attempts allowed

  • Exercise: Functional Quick Sort

  • Quiz 32

    100 attempts allowed

  • Exercise: Powerset

  • Quiz 33

    100 attempts allowed

  • Exercise: All possible partitions of a set

  • Quiz 34

    100 attempts allowed

  • Sequences

  • What is a sequence?

  • Order is important

  • Sequences do the minimum number of operations

  • Sequences can be infinite

  • Sequences do not create collections at every processing step

  • When aren’t sequences faster?

  • What about Java streams?

  • Kotlin Sequence debugging

  • Summary

  • Quiz 35

    3 attempts allowed

  • Exercise: Understanding sequences

  • Quiz 36

    100 attempts allowed

  • Type Safe DSL Builders

  • A function type with a receiver

  • Simple DSL builders

  • Using apply

  • Simple DSL-like builders

  • Multi-level DSLs

  • DslMarker

  • A more complex example

  • When should we use DSLs?

  • Summary

  • Quiz 37

    3 attempts allowed

  • Exercise: HTML table DSL

  • Quiz 38

    100 attempts allowed

  • Exercise: Creating user table row

  • Quiz 39

    100 attempts allowed

  • Scope functions

  • let

  • Mapping a single object

  • The problem with member extension functions

  • Moving an operation to the end of processing

  • Dealing with nullability

  • also

  • takeIf and takeUnless

  • apply

  • The dangers of careless receiver overloading

  • with

  • run

  • Using scope functions

  • Quiz 40

    3 attempts allowed

  • Exercise: Using scope functions

  • Quiz 41

    100 attempts allowed

  • Exercise: orThrow

  • Quiz 42

    100 attempts allowed

  • Context receivers

  • Extension function problems

  • Introducing context receivers

  • Use cases

  • Classes with context receivers

  • Concerns

  • Summary

  • Quiz 43

    3 attempts allowed

  • Exercise: Logger

  • Quiz 44

    100 attempts allowed

  • A birds-eye view of Arrow

  • Functions and Arrow Core

  • Functions and Arrow Core

  • Memoization

  • Testing higher-order functions

  • Error Handling

  • Error Handling

  • Working with nullable types

  • Working with Result

  • Working with Either

  • Data Immutability with Arrow Optics

  • Data Immutability with Arrow Optics

  • Exercise solutions

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub