summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/PGF2.hsc
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/haskell-bind/PGF2.hsc')
-rw-r--r--src/runtime/haskell-bind/PGF2.hsc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc
index f2f1b4113..4990a1926 100644
--- a/src/runtime/haskell-bind/PGF2.hsc
+++ b/src/runtime/haskell-bind/PGF2.hsc
@@ -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