:: Bool -> a -> a -> a -package:numhask
if-then-else as function.
Example:
if' (even n) "even" $
if' (isPrime n) "prime" $
"boring"
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.
for support of if .. then .. else
Because of RebindableSyntax, this is necessary to enable you to use
if-then-else expressions. No need to call it directly.
Definition of
ifThenElse for use with RebindableSyntax
This is the
if-then-else operator, With it you can write
xxx ? yyy $ zzz instead of
if xxx then yyy else zzz.
Following may or may not be cleaner to you ; )
isFoo <- checkFoo
isFoo ? foo
$ bar
Hang on the
True case of
bool.
onTrue b f t = bool f t b
Hang on the
False case of
bool.
onFalse b t f = bool f t b
Same as
bool, except the
Bool comes before the case
functions.
Equivalent type signature:
boolL :: forall r. Analysis Bool r
The implementation is just:
boolL = gcase