diff options
Diffstat (limited to 'contrib/py-bindings/PyGF.hsc')
| -rw-r--r-- | contrib/py-bindings/PyGF.hsc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/py-bindings/PyGF.hsc b/contrib/py-bindings/PyGF.hsc index 6ac5b05d7..7b9991f3e 100644 --- a/contrib/py-bindings/PyGF.hsc +++ b/contrib/py-bindings/PyGF.hsc @@ -219,6 +219,13 @@ gf_unstr pexp = do Just s -> newCString s _ -> return nullPtr +foreign export ccall gf_inferexpr :: Ptr PGF -> Ptr Expr -> Ptr Type -> IO () +gf_inferexpr ppgf pexp ptype = do + pgf <- peek ppgf + exp <- peek pexp + let Right (_,t) = inferExpr pgf exp + poke ptype t + foreign import ccall "newLang" pyLang :: IO (Ptr Language) foreign import ccall "newTree" pyTree :: IO (Ptr Tree) foreign import ccall "newCId" pyCId :: IO (Ptr CId) |
