> Tue, 31 Jul 2001 12:38:03 +0100, Simon Marlow
> <[EMAIL PROTECTED]> pisze:
>
> > That's the way I'd go. You have to declare the primitive like this,
> > BTW:
> >
> > isWHNF# :: a -> (# State# RealWorld, Int# #)
> >
> > because the compiler doesn't know about the IO type and you
> can't return
> > a Bool directly.
>
> It can return a Bool, e.g. ==# returns a Bool.
But ==# doesn't also return an unboxed tuple, and the code generator has
special hacks to deal with primops that return enumerated types. The
==# primop actually returns an Int# which the code generator arranges to
convert into a real Bool using the closure table.
I guess you could return a Bool by actually indexing into the closure
table, or by just returning {False,True}_static_closure.
Cheers,
Simon
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users