[Haskell-cafe] The kind of (->)

Stefan O'Rear stefanor at cox.net
Sun Sep 30 22:05:28 EDT 2007


On Mon, Oct 01, 2007 at 11:40:20AM +1000, jeeva suresh wrote:
> Hi Guys!
> 
> According ghci the kind of (->) is  "?? -> ? -> *"
> 
> What do the '??' mean? What is the difference between the '?' and the '*'

It's an implementation detail leaking out.  GHC uses a set of special
types to represent primitive values, and uses the kind system to enforce
that they are never used as normal types.  ? refers to ANYTHING, *
refers only to normal types, and ?? refers to normal types and some of
the special types.  This is similar to the way that statically typed OO
languages allow values of subclass types to be used as if they had
superclass types.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070930/ac15f4ee/attachment.bin


More information about the Haskell-Cafe mailing list