git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #359 from garyb/eq-ordering

Add Eq instance for Ordering

commita9173ff07b8a2797579e93ff1b1f00cd62c3716f authorPhil Freeman <paf31@cantab.net> dateMon 7 Apr 2014, 16:03 (13 years ago) parent0fd16c31696e53
1 file changed+8−1
prelude/prelude.purs+8−1
prelude/prelude.purs+8−1
@@ -8,7 +8,7 @@ module Prelude where
88
99 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
1010 on f g x y = g x `f` g y
11−
11+
1212 asTypeOf :: forall a. a -> a -> a
1313 asTypeOf x _ = x
1414
@@ -187,6 +187,13 @@ module Prelude where
187187
188188 data Ordering = LT | GT | EQ
189189
190+ instance eqOrdering :: Eq Ordering where
191+ (==) LT LT = true
192+ (==) GT GT = true
193+ (==) EQ EQ = true
194+ (==) _ _ = false
195+ (/=) x y = not (x == y)
196+
190197 instance showOrdering :: Show Ordering where
191198 show LT = "LT"
192199 show GT = "GT"