
#8061: Support for Complex Double in Foreign Function Interface -------------------------------------+------------------------------------ Reporter: dsamperi | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Sounds reasonable in principle. Someone would need to look into the FFI interface, which would need to pass and return complex numbers, or perhaps more generally structs. I don't have a clue what C's calling convention looks like for that. I think we use `libffi` to generate code, but I'm pretty hazy about the details. Or maybe it'd be enough to return multiple ''results'', dually with passing multiple arguments. So at the most primitive level you could say {{{ foreign import foo :: Double# -> Double# -> IO (# Double#, Double# #) }}} If someone is up for doing the legwork, I'm sure there are people on `ghc- devs` who can advise. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8061#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler