diff options
author | Jose Pedro Magalhaes <jpm@cs.ox.ac.uk> | 2014-11-04 11:10:27 +0000 |
---|---|---|
committer | Jose Pedro Magalhaes <jpm@cs.ox.ac.uk> | 2014-11-04 11:10:27 +0000 |
commit | 3744afb5d91ebbe235230b7e9a03e1918ed4aa2c (patch) | |
tree | ae953eebc9230a176721b49c64f8a63102b627f6 /libraries/base/Data/Bool.hs | |
parent | d8e899686d7f3092af54932f46ab122dc8d3d373 (diff) | |
parent | d3a7126ff749d1eff31128ace31bcea26c4eadaa (diff) | |
download | haskell-wip/GenericsMetaData.tar.gz |
Merge branch 'master' into wip/GenericsMetaDatawip/GenericsMetaData
Diffstat (limited to 'libraries/base/Data/Bool.hs')
-rw-r--r-- | libraries/base/Data/Bool.hs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/libraries/base/Data/Bool.hs b/libraries/base/Data/Bool.hs index 15371982ea..9f1bef6e7c 100644 --- a/libraries/base/Data/Bool.hs +++ b/libraries/base/Data/Bool.hs @@ -28,33 +28,33 @@ module Data.Bool ( import GHC.Base --- | Case analysis for the 'Bool' type. @bool x y p@ evaluates to @x@ --- when @p@ is @False@, and evaluates to @y@ when @p@ is @True@. +-- | Case analysis for the 'Bool' type. @'bool' x y p@ evaluates to @x@ +-- when @p@ is 'False', and evaluates to @y@ when @p@ is 'True'. -- --- This is equivalent to @if p then y else x@; that is, one can --- think of it as an if-then-else construct with its arguments --- reordered. +-- This is equivalent to @if p then y else x@; that is, one can +-- think of it as an if-then-else construct with its arguments +-- reordered. -- --- /Since: 4.7.0.0/ +-- /Since: 4.7.0.0/ -- --- ==== __Examples__ +-- ==== __Examples__ -- --- Basic usage: +-- Basic usage: -- --- >>> bool "foo" "bar" True --- "bar" --- >>> bool "foo" "bar" False --- "foo" +-- >>> bool "foo" "bar" True +-- "bar" +-- >>> bool "foo" "bar" False +-- "foo" -- --- Confirm that @bool x y p@ and @if p then y else x@ are --- equivalent: +-- Confirm that @'bool' x y p@ and @if p then y else x@ are +-- equivalent: -- --- >>> let p = True; x = "bar"; y = "foo" --- >>> bool x y p == if p then y else x --- True --- >>> let p = False --- >>> bool x y p == if p then y else x --- True +-- >>> let p = True; x = "bar"; y = "foo" +-- >>> bool x y p == if p then y else x +-- True +-- >>> let p = False +-- >>> bool x y p == if p then y else x +-- True -- bool :: a -> a -> Bool -> a bool f _ False = f |