I try to use haskell function in my Python program using FFI.
My function is like f :: String -> String
anyone can help me?
i have another function f2 :: [(Double,Double,Double)] -> ((Double,Double,Double),(Double,Double,Double))
edit:
i found some information here: https://github.com/nh2/call-haskell-from-anything
i know how to call function like fib :: Int -> Int in Python
ex.
module Example where
import Foreign.C.Types
fibonacci :: Int -> Int
fibonacci n = fibs !! n
where fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
fibonacci_hs :: CInt -> CInt
fibonacci_hs = fromIntegral . fibonacci . fromIntegral
foreign export ccall fibonacci_hs :: CInt -> CInt
but i don't know how to make funciton :: String -> String callable in Python
Vector Double
and pass a pointer and length. – gspr