[Haskell-cafe] AMP - how do you motivate this in teaching?

Joachim Breitner mail at joachim-breitner.de
Fri Nov 20 10:15:43 UTC 2015


Hi,

Am Freitag, den 20.11.2015, 12:02 +0200 schrieb Oleg Grenrus:
> - `Errors` [4], 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.

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://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...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151120/5052e8c2/attachment.sig>


More information about the Haskell-Cafe mailing list