-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeRep in data type does not work with genSingletons. #503
Comments
Indeed,
|
My use case is to use I then have a constructor whose type looks like: HsTerm :: Typeable a => a -> MvTerm s ('MvHsT typeRep) to build up raw haskell expressions embedded into my EDSL. |
Ah, OK, so you want to use the type TypeRep :: proxy a -> Type
type family TypeRep pa where
TypeRep @proxy @a _ = a Then you'd need a separate, type-level-only version of If this seems rather ugly, it's because it is. But this is the current state of things. |
With singletons-3.0 and singletons-th-3.0, if I try to generate a singled data type with
TypeRep
as one of the fields, withgenSingletons
, for instance:I get the following exception in GHC:
I know that there are issues with
TypeRep
promotion, as documented here, however, I was not able to find any documentation explaining how to useData.Singletons.Base.TypeRepTYPE
to create a singled version of a data type containingTypeRep
.Note: a related issue looks like it had a workaround added in 3.0 so
genSingletons
works correctly with data types withNat
s, so I am wondering if it is possible to add a workaround forTypeRep
as well.The text was updated successfully, but these errors were encountered: