0 | module Algebra.Preorder
6 | interface Preorder a where
7 | (<=) : a -> a -> Bool
8 | preorderRefl : {x : a} -> x <= x = True
9 | preorderTrans : {x, y, z : a} -> x <= y = True -> y <= z = True -> x <= z = True
13 | lub : Preorder a => a -> a -> a
14 | lub x y = if x <= y then y else x
18 | glb : Preorder a => a -> a -> a
19 | glb x y = if x <= y then x else y
23 | (<) : (Preorder a, Eq a) => a -> a -> Bool
24 | (<) x y = x <= y && x /= y
28 | interface Preorder a => Top a where
30 | topAbs : {x : a} -> x <= top = True