Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
Is there an automated way to derive Eq for this type?
Eq
data Foo = forall r. Foo (Bar r, Baz r)
Going manual for now:
data NeuronLink = forall r. NeuronLink (Query r, QueryConnection r, QueryViewTheme r) instance Eq NeuronLink where (==) (NeuronLink (Query_ZettelByID zid1, c1, t1)) (NeuronLink (Query_ZettelByID zid2, c2, t2)) = and [zid1 == zid2, c1 == c2, t1 == t2] (==) (NeuronLink (Query_ZettelsByTag p1, c1, t1)) (NeuronLink (Query_ZettelsByTag p2, c2, t2)) = and [p1 == p2, c1 == c2, t1 == t2] (==) (NeuronLink (Query_Tags p1, c1, t1)) (NeuronLink (Query_Tags p2, c2, t2)) = and [p1 == p2, c1 == c2, t1 == t2] (==) _ _ = False
I suspect GEq and deriveGEq can simplify that instance.
GEq
deriveGEq
don't think so
generics can't yet represent existentials
TH probably can tho
kind-generics is the future of generics :)
when we get them :)
Is there an automated way to derive
Eq
for this type?Going manual for now:
I suspect
GEq
andderiveGEq
can simplify that instance.don't think so
generics can't yet represent existentials
TH probably can tho
kind-generics is the future of generics :)
when we get them :)