Haskell's syntax

Arjan van IJzendoorn afie@cs.uu.nl
Tue, 22 Apr 2003 18:08:32 +0200


Hello Peter,

> I don't know why you mind the bar. It always denotes disjoint union.

signum x
  | x < 0 = -1
  | x == 0 = 0
  | otherwise = 1

The guards are not disjoint and '|' is not an operator, it *begins* a
guarded expression.

> data Tree a = Bin (Tree a) a (Tree a) | Nil
>
> directly represents the domain equation whose least solution is
> the semantics of Tree a. It cannot be written more clearly.

:-) We're talking first-year students here.

Greetings, Arjan