-- | Extra functions for dealing with Bool.

module Data.Bool.Extra
  (bool
  ,cond)
  where

-- | bool false true p = if p then true else false
bool :: a -> a -> Bool -> a
bool false true p = if p then true else false

-- | cond false true p v = if p v then true v else false v
cond :: (a -> b) -> (a -> b) -> (a -> Bool) -> a -> b
cond false true p v = if p v then true v else false v