September 2018
Intermediate to advanced
398 pages
9h 43m
English
As you would expect, Applicative must conform to some laws.
Given a type F that has an Applicative[F] instance, for all types A given an instance fa: F[A], the following equalities must be verified:
((identity[A] _).pure[F] <*> fa) == faWhen we put the identity function in a F context using pure and call <*> on fa, it does not change fa. It is similar to the identity law in Functor.
(fbc <*> (fab <*> fa)) == ((fbc.map(_.compose[A] _) <*> fab) <*> fa)
It is similar to the composition preservation in Functor . By using compose, we can change the parenthesis around the <*> expressions without changing ...
Read now
Unlock full access