HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleutility-ht-0.0.17.2Haskell98

Data.Bool.HT

  • 5 values
valueif' :: Bool -> a -> a -> a
#

if-then-else as function.

Example:

if' (even n) "even" $
if' (isPrime n) "prime" $
"boring"
valueifThenElse :: Bool -> a -> a -> a
#

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.

valueselect :: a -> [(Bool, a)] -> a
#

From a list of expressions choose the one, whose condition is true.

Example:

select "boring" $
  (even n, "even") :
  (isPrime n, "prime") :
  []
value(?:) :: Bool -> (a, a) -> a
#

Like the ? operator of the C progamming language.

Example2 expressions
True ?: ("yes", "no")"yes"False ?: ("yes", "no")"no"
valueimplies :: Bool -> Bool -> Bool
#

Logical operator for implication.

Funnily because of the ordering of Bool it holds:

Property
\a b -> implies a b == (a<=b)