Re: [Bug?] AST representation of type-synonyms with phantom parameters

"Alfonso Acosta" <[email protected]> Mon, 29 Oct 2007 14:27:37 +0100
Newsgroups gmane.comp.lang.haskell.template
Message-ID <[email protected]>
It seems to be a general GHC-issue (due to the internal representation
of type-synonyms with phantom types)

For example:

*Phantom Language.Haskell.TH> let f = (\_-> 1) :: PhantomSyn a -> Int
*Phantom Language.Haskell.TH> f "a"

<interactive>:1:2:
    Couldn't match expected type `PhantomSyn GHC.Prim.Any'
           against inferred type `[Char]'
      Expected type: PhantomSyn GHC.Prim.Any
      Inferred type: [Char]
    In the first argument of `f', namely `"a"'
    In the expression: f "a"


Pay attention to the error, it says:

PhantomSyn GHC.Prim.Any

instead of

Expected type: PhantomSyn a

Again, should this be considered a bug?

I don't think the end-user should know anything about GHC.Prim.Any.
The error is a bit confusing.

However, I still think that independently of how does GHC represent
type synonyms with phantom parameters, TH should represent their type
variables as such, and not as "GHC.Prim.Any"