Eq1, Ord1, Show1: move from eq1, compare1, showsPrec1 to liftEq, liftCompare, liftShowsPrec

Henning Thielemann lemming at henning-thielemann.de
Sun Jan 10 13:08:54 UTC 2016


In transformers-0.5:Data.Functor.Classes class methods like eq1 are 
replaced by liftEq.


With transformers-0.4 I could define:

data T a = complicated definition ...
    deriving (Eq, Ord, Show)

instance Eq1 T where eq1 = (==)
instance Ord1 T where compare1 = compare
instance Show1 T where showsPrec1 = showsPrec


In transformers-0.5 it seems that I have to implement Eq1, Ord1, Show1 
instances manually. Is there some assistance to define eq1 and compare1 
for an ADT? What are the use cases where eq1 was not powerful enough and 
liftEq is needed?


More information about the Libraries mailing list