Open Icelandjack opened 8 years ago
Nice! Where is ForallF
defined?
It's defined in the constraints
package (Data.Constraints.Forall
) which is already a dependency of syntactic
.
Eq1
, Show1
, ... just got added to base
in the GHC 8 release: to Data.Functor.Classes
and they are very similar, compare
class Eq1 f where
liftEq :: (a -> b -> Bool) -> f a -> f b -> Bool
class Equality e where
equal :: e a -> e b -> Bool
ForallF Eq
would not allow comparing elements of different argument types, so I'm not sure how this all fits together to be honest (obviously Eq1
doesn't have a hash :: e a -> Hash
method and Show1
doesn't have renderArgs
) but I thought I'd mention it
You can create a show instance for
AST sym sig
, if you if you say thatforall sig. Show (sym sig)
.That can be achieved by
Show1
orForallF Show
:Now any symbol domain that has a show instance parametric in its semantic type can be shown, are there any benefits to doing it like this?