Matthew Bromberg <[EMAIL PROTECTED]> writes:
> 1) Hat looks really interesting thanks. Hopefully it will run on windows.
Under mingw or cygwin, possibly. Natively, not.
> 3) The problem here is existing code. I don't want to add every
> function that I use into a class just to maintain simple polymorphism
> over closely related numeric types. This would take longer than just
> calling the coercion routines.
Possibly you just need to move the coercions to a single more manageable
location. e.g. you could rename the FFI calls, then wrap them with a
simple coercion function, and call it by the original name.
inject :: CInt -> Int
eject :: Int -> CInt
foreign import ccall "blah" prim_blah :: CInt -> CInt
blah x = inject (prim_blah (eject x))
By the way, there are tools for generating FFI bindings that can create
code like this (e.g. GreenCard).
Regards,
Malcolm
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe