- The desugaring
- Preservation of Monad semantics
- Applicatives without Monads
- When Applicative is more efficient
- With only a Functor
do notation is syntactic sugar over monadic functions and desugars into monadic combinators such as
ApplicativeDo language extension enables an alternate desugaring, allowing
do syntax to be used in an
Applicative context as well.
There are two reasons to enable the
- When a type constructor has an
- When composition using
(<*>)is more efficient than the corresponding composition using
There is (in principle) no reason not to enable
ApplicativeDo, but see the preservation of monad semantics section below for caveats.
ApplicativeDo was introduced into GHC Release notes for GHC 8.0.1 in version 8.0.1 in 2016.