On Tuesday 05 August 2003 4:00 pm, Simon Peyton-Jones wrote:
| id# :: (a :: # ) - a
| id# x = x
That should really be rejected. You couldn't call it because you'd have
to instantiate 'a' to Int# or Double#, and that would mean different
code for different calls.
GHC (after modifying the
On Tuesday 05 August 2003 1:51 pm, Simon Peyton-Jones wrote:
The real question is:
why does GHC distinguish kind * from kind #?
For example, Int has kind *
Int# has kind #
The main reason is this: a polymorphic function assumes that values of
type 'a' are
| All right. I do expect the compiler to yell if a polymorphic function
is
| ever effectively applied to an unboxed value. Does this mean that
| forcing kinds to # will not work, for example as in
| id# :: (a :: # ) - a
| id# x = x
That should really be rejected. You couldn't call it because
-notation, but it seems a bit ad
hoc.
Simon
| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
| On Behalf Of Sebastien Carlier
| Sent: 04 August 2003 16:09
| To: [EMAIL PROTECTED]
| Subject: Polymorphic kinds
|
|
| Hello,
|
| I am experimenting with GHC
polymorphic kinds - after checking a bunch of definitions, it
zonks all kind variables to (Type *) and all boxity variables to *.
So IO has kind (Type * - Type *), and cannot be applied to an unboxed
value of kind (Type #).
GHC has had explicit kind annotations for a while:
http://www.haskell.org/pipermail
The ultimate goal is to write a
prototype operating system in Haskell, using the GHC RTS as a kind of
microkernel
As a useful stepping stone towards that goal, you might look at Utah's OSKit:
http://www.cs.utah.edu/flux/oskit/
It gives you a bunch of useful bits like bootloaders, device