added exprSize in the Haskell binding

This commit is contained in:
Krasimir Angelov
2017-09-05 09:50:29 +02:00
parent a5fe5b9378
commit 85cf2d9f5a
4 changed files with 47 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ module PGF2 (-- * PGF
mkFloat,unFloat,
mkMeta,unMeta,
mkCId,
exprHash,
exprHash, exprSize,
treeProbability,
-- ** Types
@@ -331,7 +331,13 @@ exprHash h (Expr c_expr touch1) =
touch1
return (fromIntegral h)
exprSize :: Expr -> Int32
exprSize (Expr c_expr touch1) =
unsafePerformIO $ do
size <- pgf_expr_size c_expr
touch1
return (fromIntegral size)
-----------------------------------------------------------------------------
-- Graphviz