qforeign-0.62

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Fri Dec 1 02:28:31 EST 2000


Fri, 01 Dec 2000 13:10:43 +1100, Manuel M. T. Chakravarty <chak at cse.unsw.edu.au> pisze:

> Instead of the 
> 
>   newtype Window = Window ForeignObj
> 
> way of wrapping foreign ADTs that we used so far, should we
> use
> 
>   newtype WindowTag = WindowTag ()
>   type    Window    = ForeignObj WindowTag
> 
> ?

This exposes the fact that Window is a ForeignObj. Ok, but maybe some
people want it to be more abstract - clients need not to know that
it's just a ForeignObj. Such type is usually exported.

BTW, IMHO it's more natural to write
    data WindowTag = WindowTag
and it would be yet more natural (and would avoid ghc's warning about
a constructor which is never used) if we were allowed to write
    data WindowTag
to create a void type.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTÊPCZA
QRCZAK





More information about the FFI mailing list