fp-ts Tutorial | Chapter 3.3: Either flatMap (chain)

preview_player
Показать описание
In Chapter 3.3 of this fp-ts tutorial (functional programming in TypeScript), we will introduce Either flatMap (also known as chain in prior versions of fp-ts), which allows us to perform a sequence of operations that can fail.

00:00 Sequential operations that can fail
00:30 decodeUser example
00:53 decodeUser implementation
04:13 Step by step walk-through
06:23 Either flatMap vs chain
Рекомендации по теме
Комментарии
Автор

wake up babe, new mrfunctor video dropped

markzuckerbread
Автор

Pretty cool to see this library mature from a Scala dev's perspective

It looks good enough now that it can be used for most basic operations you do in functional programming in a common industry codebase :) Ill surely be reaching for it if I ever settle in a TS codebase in the future!

Keep up the videos!

hotharvey
Автор

Your videos are great! Can't wait for next ones cause I've just started to learn fp-ts. Wish you all the best

ptube
Автор

Glad to see you are back. Thanks for the video!

davidvpe
Автор

Love this series after struggling with fp-ts for so long. Do you plan on covering Reader / ReaderTask / ReaderTaskEither at some point?

ryanmarshall
Автор

great, thank you, wating so long time

decentralizedvietnam
Автор

Isn't flatMap in this case a misnomer? In haskell fmap is just map for functors I think. The reason why it is prefixed with "f" is that map is already the name of a function which works exclusively on lists, so it was named fmap (functor-map).

The fact that we are doing things which look like flattening doesn't actually have anything to do with the "f" in fmap.

If I am correct, I really wish fp-ts had chosen a diffetent name.

ludwignagelhus
Автор

Please explain why E.tryCatchK and not E.tryCatch?

dawid_dahl
Автор

I like the thinking here but this code is very difficult to read.

whatthefunction
join shbcf.ru