This section could be made more beginner-friendly:
https://book.purescript.org/chapter8.html#monads-and-applicatives
Inspired by #184
Improvement ideas:
1. A concrete example of using ap for an Apply instance.
Replace F with another type
instance applyF :: Apply F where
apply = ap
https://pursuit.purescript.org/packages/purescript-prelude/4.1.1/docs/Control.Monad#v:ap
2. Note that even though Monad depends on Apply, the implementation of apply can depend on Monad. This flexibility may be unexpected by readers.
3. Change
Try writing userCity using only pure and apply
to
Try writing userCity using only what's available from Applicative (map, apply, pure) and without the additional Bind capabilities of Monad. This means no using bind or <- in do notation.
This section could be made more beginner-friendly:
https://book.purescript.org/chapter8.html#monads-and-applicatives
Inspired by #184
Improvement ideas:
1. A concrete example of using
apfor anApplyinstance.Replace
Fwith another typehttps://pursuit.purescript.org/packages/purescript-prelude/4.1.1/docs/Control.Monad#v:ap
2. Note that even though
Monaddepends onApply, the implementation ofapplycan depend onMonad. This flexibility may be unexpected by readers.3. Change
to