Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
An example using arithmetic expressions.
Synopsis
- data Arith
- data ArithF r
- = ArithPlusF r r
- | ArithTimesF r r
- | ArithShiftLF r !Int
- | ArithShiftRF r !Int
- | ArithConstF !Int
- exampleGraph :: EGraph () ArithF
- examplePat :: Pat ArithF String
- exampleMain :: IO ()
Documentation
Arithmetic expressions.
ArithF
is the base functor for this type.
ArithPlus Arith Arith | |
ArithTimes Arith Arith | |
ArithShiftL Arith !Int | |
ArithShiftR Arith !Int | |
ArithConst !Int |
Instances
ArithPlusF r r | |
ArithTimesF r r | |
ArithShiftLF r !Int | |
ArithShiftRF r !Int | |
ArithConstF !Int |
Instances
exampleGraph :: EGraph () ArithF Source #
Creates a simple e-graph with the equality `2 + 2 = 4`.
exampleMain :: IO () Source #
Build an e-graph, e-match on it, and print the result.