Using higher-order Haskell types in C#

前端 未结 2 2045
抹茶落季
抹茶落季 2021-02-11 20:16

How can I use and call Haskell functions with higher-order type signatures from C# (DLLImport), like...

double :: (Int -> Int) -> Int -> Int -- higher o         


        
2条回答
  •  灰色年华
    2021-02-11 20:56

    Did you tried exporting the functions via the FFI? This allows you to create a more C-ish interface to the functions. I doubt that it is possible to call Haskell functions directly from C#. See the doc for more information. (Link above).

    After doing some tests, I think that generally, it is not possible to export high order functions and functions with type-parameters via the FFI.[Citation needed]

提交回复
热议问题