Commit cfa933bd authored by Steffen Michels's avatar Steffen Michels

move < instance of Either to Data.Either.Ord

parent 07fbd460
Pipeline #19702 failed with stage
in 2 minutes and 48 seconds
......@@ -5,7 +5,7 @@ definition module Data.Either
* used inside generic functions, since most generic functions treat this
* type in a special way which may lead to strange behavior.
*/
from StdOverloaded import class ==, class <
from StdOverloaded import class ==
from Control.Applicative import class pure, class <*>, class Applicative, class *>, class <*, class Alternative
from Control.Monad import class Monad
from Data.Functor import class Functor
......@@ -18,7 +18,6 @@ from Data.GenEq import generic gEq
:: Either a b = Left a | Right b
instance == (Either a b) | == a & == b
instance < (Either a b) | < a & < b
instance Functor (Either a)
instance pure (Either e)
instance <*> (Either e)
......
......@@ -17,12 +17,6 @@ instance == (Either a b) | == a & == b where
== (Right x) (Right y) = x == y
== _ _ = False
instance < (Either a b) | < a & < b where
< (Left x) (Left y) = x < y
< (Right x) (Right y) = x < y
< (Left _) (Right _) = True
< (Right _) (Left _) = False
instance Functor (Either a) where
fmap f (Left l) = Left l
fmap f (Right r) = Right (f r)
......
definition module Data.Either.Ord
from StdOverloaded import class <
from Data.Either import :: Either
instance < (Either a b) | < a & < b
implementation module Data.Either.Ord
import StdEnv
import Data.Either
instance < (Either a b) | < a & < b where
< (Left x) (Left y) = x < y
< (Right x) (Right y) = x < y
< (Left _) (Right _) = True
< (Right _) (Left _) = False
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment