| Copyright | (c) 2008-2014 Twan van Laarhoven |
|---|---|
| License | BSD-style |
| Maintainer | twanvl@gmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell98 |
Debug.SimpleReflect.Expr
Contents
Description
Simple reflection of haskell expressions containing variables.
Construction
A reflected expression
Instances
| Bounded Expr # | |
| Enum Expr # | |
| Eq Expr # | |
| Floating Expr # | |
| Fractional Expr # | |
| Integral Expr # | |
| Num Expr # | |
| Ord Expr # | |
| Real Expr # | |
Defined in Debug.SimpleReflect.Expr Methods toRational :: Expr -> Rational # | |
| Show Expr # | |
| Semigroup Expr # | |
| Monoid Expr # | |
| FromExpr Expr # | |
Defined in Debug.SimpleReflect.Expr | |
Conversion from Expr to other types
Minimal complete definition
data Associativity #
This data type specifies the associativity of operators: left, right or none.
Instances
| Eq Associativity # | |
Defined in Debug.SimpleReflect.Expr Methods (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool # | |
op :: Associativity -> Int -> String -> Expr -> Expr -> Expr #
An infix operator with the given associativity, precedence and name
Evaluating
Reduce (evaluate) an expression once.
For example reduce (1 + 2 + 3 + 4) == 3 + 3 + 4