Differences
This shows you the differences between two versions of the page.
minimum_function [2014/02/22 19:42] nikolaj old revision restored (2014/02/13 16:13) |
minimum_function [2014/03/21 11:11] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Minimum function ===== | ||
- | ==== Set ==== | ||
- | | @#88DDEE: $X$ | | ||
- | | @#88DDEE: $\le$ ... non-strict partial order over $X$ | | ||
- | | @#FFBB00: $\mathrm{max}:X\times X\to X $ | | ||
- | | @#FFBB00: $ \mathrm{max}(x,y) := \begin{cases} x & \mathrm{if}\ x\le y\\\\ y & \mathrm{else} \end{cases}$ | | ||
- | |||
- | ==== Discussion ==== | ||
- | === Code === | ||
- | <code haskell> | ||
- | mnmInt :: [Int] -> Int | ||
- | mnmInt [] = error "empty list" | ||
- | mnmInt [x] = x | ||
- | mnmInt (x:xs) = min x (mnmInt xs) | ||
- | </code> | ||
- | ==== Parents ==== | ||
- | === Context === | ||
- | [[Non-strict partial order]] | ||
- | === Element of === | ||
- | [[Binary operation]] | ||
- | === Related === | ||
- | [[Maximum function]] |