Skip to content

Support for Complex Double in Foreign Function Interface

Currently the FFI only permits BASIC return types like Double, Int, Bool, etc., but NOT Complex Double (only slightly non-basic!). This makes it impossible to import a Fortran function (not subroutine) that returns a complex value. Adding support for Complex Double would make it easier to interface to external libs like BLAS and LAPACK; without this support wrapper C libs must be used, and these are not standardized (the Haskell package hs-linear-algebra currently has some problems related to this).

Thus adding Foreign support for Complex Double (not just through Ptr) would open up access to a large collection of external Fortran libs for the Haskell community. Currently I get the message "Unacceptable return type in FFI" when I try to return IO (ComplexType).

Trac metadata
Trac field Value
Version 7.6.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information