shithub: MicroHs

Download patch

ref: 91dee9970976f664da32507759a1b6176d928cf5
parent: e730831247664c2979740105badac56fb7803a9b
author: Lennart Augustsson <lennart@augustsson.net>
date: Sat Jul 13 16:06:31 EDT 2024

Derive Eq and Ord for Either

--- a/lib/Data/Either.hs
+++ b/lib/Data/Either.hs
@@ -12,11 +12,7 @@
 import Text.Show
 
 data Either a b = Left a | Right b
-
-instance forall a b . (Eq a, Eq b) => Eq (Either a b) where
-  Left  a == Left  a'  =  a == a'
-  Right b == Right b'  =  b == b'
-  _       == _         =  False
+  deriving (Eq, Ord)
 
 either :: forall a b r . (a -> r) -> (b -> r) -> Either a b -> r
 either f _ (Left  a) = f a
--