Fri, 01 Dec 2000 13:10:43 +1100, Manuel M. T. Chakravarty <[EMAIL PROTECTED]> 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 * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK


_______________________________________________
FFI mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/ffi

Reply via email to