Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Functor

Another frequently encountered type class in functional programming is Functor. Functor is all about the map function in its essence. As you may recall from the previous chapters, the map function is very similar to flatMap function; however, it takes a non-side effecting computation as its argument. It is used to transform a value within the context of a effect type when this transformation is not side effecting itself.

You might want to use a Functor if you want to do something with the result of a side effecting computation without extracting it from its effect type.

As you may recall, we used an intuition of sequential composition in the case of the flatMap of a Monad. This intuition may not be the best one for Functor. In the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content