git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #359 from garyb/eq-ordering
a9173ffPhil Freeman
prelude/prelude.purs+8−1
@@ -8,7 +8,7 @@ module Prelude where
8
8
9 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
9 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
10 on f g x y = g x `f` g y
10 on f g x y = g x `f` g y
11−
11+
12 asTypeOf :: forall a. a -> a -> a
12 asTypeOf :: forall a. a -> a -> a
13 asTypeOf x _ = x
13 asTypeOf x _ = x
14
14
@@ -187,6 +187,13 @@ module Prelude where
187
187
188 data Ordering = LT | GT | EQ
188 data Ordering = LT | GT | EQ
189
189
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+
190 instance showOrdering :: Show Ordering where
197 instance showOrdering :: Show Ordering where
191 show LT = "LT"
198 show LT = "LT"
192 show GT = "GT"
199 show GT = "GT"