module TEST
import Prelude
record A = { int : Integer }
derive Eq A
would previously generate code like
instance Prelude.Eq A where
(==) = (\x0 -> (\x1 -> (Prelude.&&) (Prelude.True) ((Prelude.==) (a'int x0) (a'int x1)) ) )
-- ^~~~~~~~~~~~~ this is not necessary
This PR changes the generated code to be as follows
instance Prelude.Eq A where
(==) = (\x0 -> (\x1 -> (Prelude.==) (a'int x0) (a'int x1) ) )
This optimizes the generated
Eq
instances.For example,
would previously generate code like
This PR changes the generated code to be as follows