ZVON > References > Haskell reference |
Intro / Search / ZVON |
| Indexes | >> Syntax << | Prelude | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random |
Name | conditional expression |
---|---|
Description | the expression returns the value of exp2, if the value of exp1 is True. If the value of exp1 is False, it returns exp3. |
Related: | |
Bibliography: | Case Expressions [ A Gentle Introduction to Haskell ] |
Input: if True then 1 else 2
Output: 1
Input: if False then 1 else 2
Output: 2
Input: if 2>1 then "OK" else "False"
Output: "OK"