summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/haskell-bind')
-rw-r--r--src/runtime/haskell-bind/PGF2/Expr.hsc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/PGF2/Expr.hsc b/src/runtime/haskell-bind/PGF2/Expr.hsc
index af3afeef5..a03a24be3 100644
--- a/src/runtime/haskell-bind/PGF2/Expr.hsc
+++ b/src/runtime/haskell-bind/PGF2/Expr.hsc
@@ -34,6 +34,13 @@ data Expr = Expr {expr :: PgfExpr, touchExpr :: Touch}
instance Show Expr where
show = showExpr []
+instance Eq Expr where
+ (Expr e1 e1_touch) == (Expr e2 e2_touch) =
+ unsafePerformIO $ do
+ res <- pgf_expr_eq e1 e2
+ e1_touch >> e2_touch
+ return (res /= 0)
+
-- | Constructs an expression by lambda abstraction
mkAbs :: BindType -> CId -> Expr -> Expr
mkAbs bind_type var (Expr body bodyTouch) =