This is library which embeds python interpreter into haskell programs and allows calling python code from haskell and haskell from python seamlessly. This project is inspired by haskell-R. and tries to use similar conventions.
As an example take following program. It captures from environment variables
with _hs suffix. This includes haskell functions.
{-# LANGUAGE QuasiQuotes #-}
importPython.InlineimportPython.Inline.QQmain::IO()
main = withPython $dolet input = [1..10] :: [Int]
let square ::Int->IOInt
square x =pure (x * x)
print=<< runPy $do
fromPy' @[Int] =<< [pye| [ square_hs(x) for x in input_hs ] |]it would output:
[1,4,9,16,25,36,49,64,81,100]