[Haskell-cafe] AMP - how do you motivate this in teaching?
mail at joachim-breitner.de
Fri Nov 20 10:15:43 UTC 2015
Am Freitag, den 20.11.2015, 12:02 +0200 schrieb Oleg Grenrus:
> - `Errors` , which could be specialised to `Either (NonEmpty err)
> a` and `ap` would gather all errors!
this is actually a pretty nice and convincing example: „A effectful
computation (e.g. a stateless parser) that may fail in various spots
with errors, where the type system can guarantee that _all_ errors will
be reported (and not just the first found).“
Obviously a Monad cannot provide this guarantee, and obviously, there
are applications where this is impossible, so this nicely shows the
usefulness of Applicative as a separate abstraction.
Joachim “nomeata” Breitner
mail at joachim-breitner.de • http://www.joachim-breitner.de/
Jabber: nomeata at joachim-breitner.de • GPG-Key: 0xF0FBF51F
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: This is a digitally signed message part
More information about the Haskell-Cafe