
GHC amused me today with this error (context omitted): Couldn't match kind `(* -> *) -> * -> *' against `?? -> ? -> *' When matching the kinds of `t :: (* -> *) -> * -> *' and `(->) :: ?? -> ? -> *' It was a silly mistake: I had used 'lift' where I intended to use 'liftM'. But I'm thinking Haskell compilers should have some sort of option which, when the ratio of punctuation to alphanumerics in an error message exceeds a certain level, just responds to the user with a more readily comprehensible message such as "WTF, dude?" Serious question: what is the significance of the question mark and double question marks in those signatures, or better yet, where can I read about it? Anton

Hi Anton,
AFAIK the only place this is documented is in GHC source code. Please
see the section called "Main data types representing Kinds" at
http://hackage.haskell.org/packages/archive/ghc/6.10.2/doc/html/Type.html.
Basically, they are all members of GHC's internal subkind hierarchy,
which is used to distinguish between the representation of types.
For example, the "error" function can be instantiated to have the type
String -> Int# -> Int# whereas every polymorphic function you write
will only be able to be instantiated at lifted types like Int. This
reflects the fact that internally the type variable in the type of
"error" has (IIRC) kind "?". I don't know why they showed up in your
error message!
Cheers,
Max
2009/5/12 Anton van Straaten
GHC amused me today with this error (context omitted):
Couldn't match kind `(* -> *) -> * -> *' against `?? -> ? -> *' When matching the kinds of `t :: (* -> *) -> * -> *' and `(->) :: ?? -> ? -> *'
It was a silly mistake: I had used 'lift' where I intended to use 'liftM'.
But I'm thinking Haskell compilers should have some sort of option which, when the ratio of punctuation to alphanumerics in an error message exceeds a certain level, just responds to the user with a more readily comprehensible message such as "WTF, dude?"
Serious question: what is the significance of the question mark and double question marks in those signatures, or better yet, where can I read about it?
Anton
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Mon, 2009-05-11 at 20:43 -0400, Anton van Straaten wrote:
Serious question: what is the significance of the question mark and double question marks in those signatures, or better yet, where can I read about it?
I've forgotten where to find the details (try the GHC manual if you
haven't already?), but IIRC they're part of how GHC handles boxing.
--
Philippa Cowderoy

On Tue, 2009-05-12 at 14:09 +0100, Philippa Cowderoy wrote:
On Mon, 2009-05-11 at 20:43 -0400, Anton van Straaten wrote:
Serious question: what is the significance of the question mark and double question marks in those signatures, or better yet, where can I read about it?
I've forgotten where to find the details (try the GHC manual if you haven't already?), but IIRC they're part of how GHC handles boxing.
participants (4)
-
Anton van Straaten
-
Derek Elkins
-
Max Bolingbroke
-
Philippa Cowderoy