This is an old revision of the document!
Minimum function
Set
$X$ |
$\le$ … non-strict partial order over $X$ |
$\mathrm{max}:X\times X\to X $ |
$ \mathrm{max}(x,y) := \begin{cases} x & \mathrm{if}\ x\le y\\\\ y & \mathrm{else} \end{cases}$ |
Discussion
Code
mnmInt :: [Int] -> Int mnmInt [] = error "empty list" mnmInt [x] = x mnmInt (x:xs) = min x (mnmInt xs)