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'm not sure if this is a bug that can realistically be fixed, but it did actually bite me recently, so I thought I should report it. Consider the following code:
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TemplateHaskell #-}
moduleBugwhereimportData.KindimportData.ProxyimportLanguage.Haskell.TH (pprint, stringE)
importLanguage.Haskell.TH.DesugartypeMyProxy= (Proxy::k->Type)
$(pure[])
test::String
test =$(expandType (DConT ''MyProxy `DAppT` DConT ''Int) >>= stringE . pprint . typeToTH)
This expands the type synonyms in the type MyProxy Int. However, the result you get is:
λ> test
"(Data.Proxy.Proxy :: k_0 -> *) GHC.Types.Int"
Which is not well kinded. The reason this happens is that when MyProxy is reified during type synonym expansion, a kind signature of k_0 -> Type is placed on it to clarify what its kind argument is. Unfortunately, this later bites us when MyProxy is applied to an argument of kind Type (instead of kind k_0).
I'm not sure what to do here. Should we add a Known Bugs section to the README and mention this there?
The text was updated successfully, but these errors were encountered:
I'm not sure if this is a bug that can realistically be fixed, but it did actually bite me recently, so I thought I should report it. Consider the following code:
This expands the type synonyms in the type
MyProxy Int
. However, the result you get is:Which is not well kinded. The reason this happens is that when
MyProxy
is reified during type synonym expansion, a kind signature ofk_0 -> Type
is placed on it to clarify what its kind argument is. Unfortunately, this later bites us whenMyProxy
is applied to an argument of kindType
(instead of kindk_0
).I'm not sure what to do here. Should we add a Known Bugs section to the README and mention this there?
The text was updated successfully, but these errors were encountered: