From b9de5c36c0a62048abee457d89b994ebbeb7acf7 Mon Sep 17 00:00:00 2001 From: "jordi.saludes" Date: Tue, 27 Jul 2010 07:50:48 +0000 Subject: Added inferExpr to py-bindings. --- contrib/py-bindings/PyGF.hsc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'contrib/py-bindings/PyGF.hsc') 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) -- cgit v1.2.3