
2 Mar
2010
2 Mar
'10
4:19 p.m.
I'm working with FFI to make a Haskell DLL that's called by C# code. I understand how to share simple types. I've found reasonable documentation for struct-equivalents. Is there a clean way to share lists, or should I make a linked-list struct and do it manually? In other words, if I have adder :: CInt -> CInt -> CInt adder x y = (x+y) then I can use foreign export stdcall adder :: CInt -> CInt -> CInt and on the other side it behaves like int adder(int a, int b); I'd like to know what to do if I have squares :: [CInt] -> [CInt] squares = map (^2) Advice? --Kim