Idris2/samples/MyOrd.idr

11 lines
210 B
Idris
Raw Normal View History

import Data.List
[myord] Ord Nat where
compare Z (S n) = GT
compare (S n) Z = LT
compare Z Z = EQ
compare (S x) (S y) = compare @{myord} x y
testList : List Nat
testList = [3,4,1]