Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Author:Dr. Fatih Nayebi [Nayebi, Dr. Fatih]
Language: eng
Format: azw3, pdf
Tags: COM051370 - COMPUTERS / Programming / Macintosh, COM051460 - COMPUTERS / Programming / Mobile Devices, COM051390 - COMPUTERS / Programming / Open Source
Publisher: Packt Publishing
Published: 2017-04-26T04:00:00+00:00


Monads

A Monad is a type of Functor, a type that, along with map, implements the flatMap function. It is simple, right? We have a Functor with an extra functionality, and that's the flatMap implementation. So, any types that we can call map and flatMap functions over are Monads. Arrays and optionals are examples of Monads.

Monads are Functors with flatMap functions! In the following sections, we will talk about map and flatMap functions.

So far, we have learned that Functors are structures with map functions. Applicative Functors are Functors with apply functions and Monads are Functors with flatMap functions. Now, let's talk about these important functions.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.