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, 10 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc
index 037145ee6..f2f1b4113 100644
--- a/src/runtime/haskell-bind/PGF2.hsc
+++ b/src/runtime/haskell-bind/PGF2.hsc
@@ -39,6 +39,7 @@ module PGF2 (-- * PGF
mkFloat,unFloat,
mkMeta,unMeta,
mkCId,
+ exprHash,
treeProbability,
-- ** Types
@@ -323,6 +324,15 @@ treeProbability (PGF p _) (Expr c_expr touch1) =
touch1
return (realToFrac res)
+exprHash :: Int32 -> Expr -> Int32
+exprHash h (Expr c_expr touch1) =
+ unsafePerformIO $ do
+ h <- pgf_expr_hash (fromIntegral h) c_expr
+ touch1
+ return (fromIntegral h)
+
+
+
-----------------------------------------------------------------------------
-- Graphviz