on master help sign in
Merge pull request #906 from david-christiansen/unit-instances
09e277bEdwin Brady
libs/prelude/Prelude/Classes.idr+5
@@ -28,6 +28,9 @@ class Eq a where
28 x /= y = not (x == y)
28 x /= y = not (x == y)
29 x == y = not (x /= y)
29 x == y = not (x /= y)
30
30
31+instance Eq () where
32+ () == () = True
33+
31instance Eq Int where
34instance Eq Int where
32 (==) = boolOp prim__eqInt
35 (==) = boolOp prim__eqInt
33
36
@@ -88,6 +91,8 @@ class Eq a => Ord a where
88 min : a -> a -> a
91 min : a -> a -> a
89 min x y = if (x < y) then x else y
92 min x y = if (x < y) then x else y
90
93
94+instance Ord () where
95+ compare () () = EQ
91
96
92instance Ord Int where
97instance Ord Int where
93 compare x y = if (x == y) then EQ else
98 compare x y = if (x == y) then EQ else