- We can see two versions of a contrived example below, the first
- using a \hs{case} expression and the other using an \hs{if-then-else}
- expression. Both examples sums two values when they are
- equal or non-equal (depending on the given predicate, the \hs{pred}
- variable) and returns 0 otherwise. The \hs{pred} variable has the
- following, user-defined, enumeration datatype:
+ We can see two versions of a contrived example below, the first
+ (\ref{lst:code3}) using a \hs{case} expression, and the other
+ (\ref{lst:code4}) using an \hs{if-then-else} expression . Both examples
+ sums two values when they are equal or non-equal (depending on the given
+ predicate, the \hs{pred} variable) and returns 0 otherwise. The \hs{pred}
+ variable has the following, user-defined, enumeration datatype: