Typing f.e.d.

Simon Peyton-Jones simonpj at microsoft.com
Tue Feb 13 19:36:00 EST 2001


This looks plausible to me too --- but I agree with Alastair
that we should not remove support for Addr, including in f.e.d.
Backward compatibility is a pain, but lack of is a fast way
to lose customers.

Simon

| -----Original Message-----
| From: Sven Panne [mailto:Sven.Panne at informatik.uni-muenchen.de]
| Sent: 11 February 2001 16:01
| To: The Happy Bit Fiddlers
| Subject: Typing f.e.d.
| 
| 
| I have a small change request regarding foreign export dynamic.
| Currently the FFI doc says:
| 
|    topdecl 
|    : ...
|    ..
|    | 'foreign' 'export' [callconv] 'dynamic' varid :: 
| prim_type -> IO Addr
| 
| GHC additionally allows:
| 
|    prim_type -> IO Ptr
| 
| As usual the FFI "looks through" newtypes.  But now that we have
| FunPtr, the following typing makes much more sense:
| 
|    'foreign' 'export' [callconv] 'dynamic' varid :: prim_type 
| -> IO (FunPtr prim_type)
| 
| where both prim_types have to be the *same*. We should probably allow
| the old Addr-typing as well for some time to facilitate the 
| transition,
| but not the Ptr-typing (bleeding edge people will know what to do :-).
| The corresponding changes to GHC look easy, so I'd like to commit this
| if there are no objections.
| 
| Furthermore, the FFI docs still talk about Addr only, not Ptr/FunPtr.
| Now that Addr is deprecated, this should be changed, too.
| 
| Cheers,
|    Sven
| 
| _______________________________________________
| FFI mailing list
| FFI at haskell.org
| http://www.haskell.org/mailman/listinfo/ffi
| 




More information about the FFI mailing list