Generalise `Control.Monad.{when,unless,guard}`
authorHerbert Valerio Riedel <hvr@gnu.org>
Sun, 28 Sep 2014 06:46:07 +0000 (08:46 +0200)
committerHerbert Valerio Riedel <hvr@gnu.org>
Sun, 28 Sep 2014 06:47:50 +0000 (08:47 +0200)
commita07ce1654ac5b8033f2daf9270c6e182415b69ca
treec195b72f1df0c5acf11b0d8f70ca3625f76a4ada
parent071167c793489f4071c348223f9591d20dbe11a3
Generalise `Control.Monad.{when,unless,guard}`

Generalise `when`/`unless`from `Monad` to `Applicative` and `guard` from
`MonadPlus` to `Alternative` respectively.

This was made possible by the AMP and is somewhat related to #9586
(but generalising in the context of the AMP instead of the FTP)

Reviewed By: ekmett, austin

Differential Revision: https://phabricator.haskell.org/D253
libraries/base/Control/Monad.hs
libraries/base/GHC/Base.lhs
libraries/base/changelog.md