backport bifunctor

This commit is contained in:
Stephen Diehl
2016-04-09 19:57:02 -04:00
parent 806939605a
commit 1f0a5a9576
10 changed files with 84 additions and 4 deletions
+6 -2
View File
@@ -1,3 +1,6 @@
{-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Bool (
whenM
, unlessM
@@ -6,8 +9,9 @@ module Bool (
, bool
) where
import Prelude
import Control.Monad (MonadPlus, when, unless, guard)
import Data.Bool (Bool)
import Data.Function (flip)
import Control.Monad (Monad, MonadPlus, when, unless, guard, (>>=), (=<<))
bool :: a -> a -> Bool -> a
bool f t p = if p then t else f