utility-ht-0.0.6: Various small helper functions for Lists, Maybes, Tuples, Functions

Data.Bool.HT

Synopsis

if' :: Bool -> a -> a -> aSource

if-then-else as function.

if-then-else

Example:

if' (even n) "even" $ if' (isPrime n) "prime" $ "boring"

ifThenElse :: Bool -> a -> a -> aSource

The same as if', but the name is chosen such that it can be used for GHC-7.0's rebindable if-then-else syntax.

if'

select :: a -> [(Bool, a)] -> aSource

(?:) :: Bool -> (a, a) -> aSource

Like the ? operator of the C progamming language. Example: bool ?: (yes, no).

?

bool ?: (yes, no)

implies :: Bool -> Bool -> BoolSource

Logical operator for implication.

Funnily because of the ordering of Bool it holds implies == (<=).

Bool

implies == (<=)