Saturday 30 April 2016

Haskell: Boolean types

The Bool data type has only two possible values: True and False.


variable.hs
-- Booleans
flag1, flag2 :: Bool
flag1 = True
flag2 = False

*Main> :load variable.hs
[1 of 1] Compiling Main             ( variable.hs, interpreted )
Ok, modules loaded: Main.
*Main> 
*Main> flag1
True
*Main> 
*Main> flag2
False



Previous                                                 Next                                                 Home

No comments:

Post a Comment