You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a variation of the typelevel Set (a set with possibly "missing" values). I would like to find a way to define a Cmp instance for 2 type a and b so that the result depends on the names of a and b. So far I was able to write
--| taken from http://www.mchaver.com/posts/2017-12-12-type-name-to-string.htmltypefamilyTypeNamea::SymbolwhereTypeNameDouble="Double"TypeNameInt="Int"TypeNameString="String"TypeName (M1D ('MetaData name___) f()) =nameTypeNamea=TypeName (Repa())
typefamilyCmp (a::k) (b::k) ::OrderingwhereCmpab=CmpSymbol (TypeNamea) (TypeNameb)
But this approach necessitates that a and b derive Generic is there another way to achieve a meaningful "default" comparison between Haskell types which does not require any constraint?
Thanks.
The text was updated successfully, but these errors were encountered:
I am working on a variation of the typelevel Set (a set with possibly "missing" values). I would like to find a way to define a
Cmp
instance for 2 typea
andb
so that the result depends on the names ofa
andb
. So far I was able to writeBut this approach necessitates that
a
andb
deriveGeneric
is there another way to achieve a meaningful "default" comparison between Haskell types which does not require any constraint?Thanks.
The text was updated successfully, but these errors were encountered: