Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- instance Hashable LeafExpr where
- hash (Var name) = hash ("Leaf-Var", name)
- hash Star = hash "Leaf-Star"
- hash (Const n) = hash ("Leaf-Const", n)
- instance Hashable UnaryOp where
- hash (Neg) = hash "Unary-Neg"
- hash (BinNot) = hash "Unary-BinNot"
- instance Hashable BinaryOp where
- hash (Plus) = hash "Binary-Plus"
- hash (Minus) = hash "Binary-Minus"
- hash (Times) = hash "Binary-Times"
- hash (Div) = hash "Binary-Div"
- hash (Mod) = hash "Binary-Mod"
- instance Hashable NodeExpr where
- hash (Leaf node) = hash ("Leaf", node)
- hash (Unary op node) = hash ("Unary", op, node)
- hash (Binary op node node') = hash ("Binary", op, node, node')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement