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