on master help sign in
Merge pull request #906 from david-christiansen/unit-instances

Add Eq and Ord instances for ()

commit09e277b50d92c18dd96f7a18942cd88eb9a32055 authorEdwin Brady <edwin.brady@gmail.com> dateTue 18 Feb 2014, 11:13 (13 years ago) parent0f9888384004b1
1 file changed+5
libs/prelude/Prelude/Classes.idr+5
libs/prelude/Prelude/Classes.idr+5
@@ -28,6 +28,9 @@ class Eq a where
2828 x /= y = not (x == y)
2929 x == y = not (x /= y)
3030
31+instance Eq () where
32+ () == () = True
33+
3134instance Eq Int where
3235 (==) = boolOp prim__eqInt
3336
@@ -88,6 +91,8 @@ class Eq a => Ord a where
8891 min : a -> a -> a
8992 min x y = if (x < y) then x else y
9093
94+instance Ord () where
95+ compare () () = EQ
9196
9297instance Ord Int where
9398 compare x y = if (x == y) then EQ else