module Trees.Common where
import Data.Int (Int64)
import Data.Text (Text)
type Identifier = Text
data Identifier'
= Txt Identifier
| Gen IdCnt Identifier
deriving (Int -> Identifier' -> ShowS
[Identifier'] -> ShowS
Identifier' -> String
(Int -> Identifier' -> ShowS)
-> (Identifier' -> String)
-> ([Identifier'] -> ShowS)
-> Show Identifier'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Identifier' -> ShowS
showsPrec :: Int -> Identifier' -> ShowS
$cshow :: Identifier' -> String
show :: Identifier' -> String
$cshowList :: [Identifier'] -> ShowS
showList :: [Identifier'] -> ShowS
Show, Identifier' -> Identifier' -> Bool
(Identifier' -> Identifier' -> Bool)
-> (Identifier' -> Identifier' -> Bool) -> Eq Identifier'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Identifier' -> Identifier' -> Bool
== :: Identifier' -> Identifier' -> Bool
$c/= :: Identifier' -> Identifier' -> Bool
/= :: Identifier' -> Identifier' -> Bool
Eq, Eq Identifier'
Eq Identifier'
-> (Identifier' -> Identifier' -> Ordering)
-> (Identifier' -> Identifier' -> Bool)
-> (Identifier' -> Identifier' -> Bool)
-> (Identifier' -> Identifier' -> Bool)
-> (Identifier' -> Identifier' -> Bool)
-> (Identifier' -> Identifier' -> Identifier')
-> (Identifier' -> Identifier' -> Identifier')
-> Ord Identifier'
Identifier' -> Identifier' -> Bool
Identifier' -> Identifier' -> Ordering
Identifier' -> Identifier' -> Identifier'
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Identifier' -> Identifier' -> Ordering
compare :: Identifier' -> Identifier' -> Ordering
$c< :: Identifier' -> Identifier' -> Bool
< :: Identifier' -> Identifier' -> Bool
$c<= :: Identifier' -> Identifier' -> Bool
<= :: Identifier' -> Identifier' -> Bool
$c> :: Identifier' -> Identifier' -> Bool
> :: Identifier' -> Identifier' -> Bool
$c>= :: Identifier' -> Identifier' -> Bool
>= :: Identifier' -> Identifier' -> Bool
$cmax :: Identifier' -> Identifier' -> Identifier'
max :: Identifier' -> Identifier' -> Identifier'
$cmin :: Identifier' -> Identifier' -> Identifier'
min :: Identifier' -> Identifier' -> Identifier'
Ord)
type IdCnt = Integer
data BinaryOperator
=
BoolOp BooleanOperator
|
ArithOp ArithmeticOperator
|
CompOp ComparisonOperator
deriving (Int -> BinaryOperator -> ShowS
[BinaryOperator] -> ShowS
BinaryOperator -> String
(Int -> BinaryOperator -> ShowS)
-> (BinaryOperator -> String)
-> ([BinaryOperator] -> ShowS)
-> Show BinaryOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BinaryOperator -> ShowS
showsPrec :: Int -> BinaryOperator -> ShowS
$cshow :: BinaryOperator -> String
show :: BinaryOperator -> String
$cshowList :: [BinaryOperator] -> ShowS
showList :: [BinaryOperator] -> ShowS
Show, BinaryOperator -> BinaryOperator -> Bool
(BinaryOperator -> BinaryOperator -> Bool)
-> (BinaryOperator -> BinaryOperator -> Bool) -> Eq BinaryOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BinaryOperator -> BinaryOperator -> Bool
== :: BinaryOperator -> BinaryOperator -> Bool
$c/= :: BinaryOperator -> BinaryOperator -> Bool
/= :: BinaryOperator -> BinaryOperator -> Bool
Eq)
data UnaryOperator
=
UnMinusOp
deriving (Int -> UnaryOperator -> ShowS
[UnaryOperator] -> ShowS
UnaryOperator -> String
(Int -> UnaryOperator -> ShowS)
-> (UnaryOperator -> String)
-> ([UnaryOperator] -> ShowS)
-> Show UnaryOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UnaryOperator -> ShowS
showsPrec :: Int -> UnaryOperator -> ShowS
$cshow :: UnaryOperator -> String
show :: UnaryOperator -> String
$cshowList :: [UnaryOperator] -> ShowS
showList :: [UnaryOperator] -> ShowS
Show, UnaryOperator -> UnaryOperator -> Bool
(UnaryOperator -> UnaryOperator -> Bool)
-> (UnaryOperator -> UnaryOperator -> Bool) -> Eq UnaryOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UnaryOperator -> UnaryOperator -> Bool
== :: UnaryOperator -> UnaryOperator -> Bool
$c/= :: UnaryOperator -> UnaryOperator -> Bool
/= :: UnaryOperator -> UnaryOperator -> Bool
Eq, Int -> UnaryOperator
UnaryOperator -> Int
UnaryOperator -> [UnaryOperator]
UnaryOperator -> UnaryOperator
UnaryOperator -> UnaryOperator -> [UnaryOperator]
UnaryOperator -> UnaryOperator -> UnaryOperator -> [UnaryOperator]
(UnaryOperator -> UnaryOperator)
-> (UnaryOperator -> UnaryOperator)
-> (Int -> UnaryOperator)
-> (UnaryOperator -> Int)
-> (UnaryOperator -> [UnaryOperator])
-> (UnaryOperator -> UnaryOperator -> [UnaryOperator])
-> (UnaryOperator -> UnaryOperator -> [UnaryOperator])
-> (UnaryOperator
-> UnaryOperator -> UnaryOperator -> [UnaryOperator])
-> Enum UnaryOperator
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: UnaryOperator -> UnaryOperator
succ :: UnaryOperator -> UnaryOperator
$cpred :: UnaryOperator -> UnaryOperator
pred :: UnaryOperator -> UnaryOperator
$ctoEnum :: Int -> UnaryOperator
toEnum :: Int -> UnaryOperator
$cfromEnum :: UnaryOperator -> Int
fromEnum :: UnaryOperator -> Int
$cenumFrom :: UnaryOperator -> [UnaryOperator]
enumFrom :: UnaryOperator -> [UnaryOperator]
$cenumFromThen :: UnaryOperator -> UnaryOperator -> [UnaryOperator]
enumFromThen :: UnaryOperator -> UnaryOperator -> [UnaryOperator]
$cenumFromTo :: UnaryOperator -> UnaryOperator -> [UnaryOperator]
enumFromTo :: UnaryOperator -> UnaryOperator -> [UnaryOperator]
$cenumFromThenTo :: UnaryOperator -> UnaryOperator -> UnaryOperator -> [UnaryOperator]
enumFromThenTo :: UnaryOperator -> UnaryOperator -> UnaryOperator -> [UnaryOperator]
Enum, UnaryOperator
UnaryOperator -> UnaryOperator -> Bounded UnaryOperator
forall a. a -> a -> Bounded a
$cminBound :: UnaryOperator
minBound :: UnaryOperator
$cmaxBound :: UnaryOperator
maxBound :: UnaryOperator
Bounded)
data BooleanOperator
=
AndOp
|
OrOp
deriving (Int -> BooleanOperator -> ShowS
[BooleanOperator] -> ShowS
BooleanOperator -> String
(Int -> BooleanOperator -> ShowS)
-> (BooleanOperator -> String)
-> ([BooleanOperator] -> ShowS)
-> Show BooleanOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BooleanOperator -> ShowS
showsPrec :: Int -> BooleanOperator -> ShowS
$cshow :: BooleanOperator -> String
show :: BooleanOperator -> String
$cshowList :: [BooleanOperator] -> ShowS
showList :: [BooleanOperator] -> ShowS
Show, BooleanOperator -> BooleanOperator -> Bool
(BooleanOperator -> BooleanOperator -> Bool)
-> (BooleanOperator -> BooleanOperator -> Bool)
-> Eq BooleanOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BooleanOperator -> BooleanOperator -> Bool
== :: BooleanOperator -> BooleanOperator -> Bool
$c/= :: BooleanOperator -> BooleanOperator -> Bool
/= :: BooleanOperator -> BooleanOperator -> Bool
Eq, Int -> BooleanOperator
BooleanOperator -> Int
BooleanOperator -> [BooleanOperator]
BooleanOperator -> BooleanOperator
BooleanOperator -> BooleanOperator -> [BooleanOperator]
BooleanOperator
-> BooleanOperator -> BooleanOperator -> [BooleanOperator]
(BooleanOperator -> BooleanOperator)
-> (BooleanOperator -> BooleanOperator)
-> (Int -> BooleanOperator)
-> (BooleanOperator -> Int)
-> (BooleanOperator -> [BooleanOperator])
-> (BooleanOperator -> BooleanOperator -> [BooleanOperator])
-> (BooleanOperator -> BooleanOperator -> [BooleanOperator])
-> (BooleanOperator
-> BooleanOperator -> BooleanOperator -> [BooleanOperator])
-> Enum BooleanOperator
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: BooleanOperator -> BooleanOperator
succ :: BooleanOperator -> BooleanOperator
$cpred :: BooleanOperator -> BooleanOperator
pred :: BooleanOperator -> BooleanOperator
$ctoEnum :: Int -> BooleanOperator
toEnum :: Int -> BooleanOperator
$cfromEnum :: BooleanOperator -> Int
fromEnum :: BooleanOperator -> Int
$cenumFrom :: BooleanOperator -> [BooleanOperator]
enumFrom :: BooleanOperator -> [BooleanOperator]
$cenumFromThen :: BooleanOperator -> BooleanOperator -> [BooleanOperator]
enumFromThen :: BooleanOperator -> BooleanOperator -> [BooleanOperator]
$cenumFromTo :: BooleanOperator -> BooleanOperator -> [BooleanOperator]
enumFromTo :: BooleanOperator -> BooleanOperator -> [BooleanOperator]
$cenumFromThenTo :: BooleanOperator
-> BooleanOperator -> BooleanOperator -> [BooleanOperator]
enumFromThenTo :: BooleanOperator
-> BooleanOperator -> BooleanOperator -> [BooleanOperator]
Enum, BooleanOperator
BooleanOperator -> BooleanOperator -> Bounded BooleanOperator
forall a. a -> a -> Bounded a
$cminBound :: BooleanOperator
minBound :: BooleanOperator
$cmaxBound :: BooleanOperator
maxBound :: BooleanOperator
Bounded)
data ArithmeticOperator
=
PlusOp
|
MinusOp
|
MulOp
|
DivOp
deriving (Int -> ArithmeticOperator -> ShowS
[ArithmeticOperator] -> ShowS
ArithmeticOperator -> String
(Int -> ArithmeticOperator -> ShowS)
-> (ArithmeticOperator -> String)
-> ([ArithmeticOperator] -> ShowS)
-> Show ArithmeticOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ArithmeticOperator -> ShowS
showsPrec :: Int -> ArithmeticOperator -> ShowS
$cshow :: ArithmeticOperator -> String
show :: ArithmeticOperator -> String
$cshowList :: [ArithmeticOperator] -> ShowS
showList :: [ArithmeticOperator] -> ShowS
Show, ArithmeticOperator -> ArithmeticOperator -> Bool
(ArithmeticOperator -> ArithmeticOperator -> Bool)
-> (ArithmeticOperator -> ArithmeticOperator -> Bool)
-> Eq ArithmeticOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ArithmeticOperator -> ArithmeticOperator -> Bool
== :: ArithmeticOperator -> ArithmeticOperator -> Bool
$c/= :: ArithmeticOperator -> ArithmeticOperator -> Bool
/= :: ArithmeticOperator -> ArithmeticOperator -> Bool
Eq, Int -> ArithmeticOperator
ArithmeticOperator -> Int
ArithmeticOperator -> [ArithmeticOperator]
ArithmeticOperator -> ArithmeticOperator
ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
ArithmeticOperator
-> ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
(ArithmeticOperator -> ArithmeticOperator)
-> (ArithmeticOperator -> ArithmeticOperator)
-> (Int -> ArithmeticOperator)
-> (ArithmeticOperator -> Int)
-> (ArithmeticOperator -> [ArithmeticOperator])
-> (ArithmeticOperator
-> ArithmeticOperator -> [ArithmeticOperator])
-> (ArithmeticOperator
-> ArithmeticOperator -> [ArithmeticOperator])
-> (ArithmeticOperator
-> ArithmeticOperator
-> ArithmeticOperator
-> [ArithmeticOperator])
-> Enum ArithmeticOperator
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ArithmeticOperator -> ArithmeticOperator
succ :: ArithmeticOperator -> ArithmeticOperator
$cpred :: ArithmeticOperator -> ArithmeticOperator
pred :: ArithmeticOperator -> ArithmeticOperator
$ctoEnum :: Int -> ArithmeticOperator
toEnum :: Int -> ArithmeticOperator
$cfromEnum :: ArithmeticOperator -> Int
fromEnum :: ArithmeticOperator -> Int
$cenumFrom :: ArithmeticOperator -> [ArithmeticOperator]
enumFrom :: ArithmeticOperator -> [ArithmeticOperator]
$cenumFromThen :: ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
enumFromThen :: ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
$cenumFromTo :: ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
enumFromTo :: ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
$cenumFromThenTo :: ArithmeticOperator
-> ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
enumFromThenTo :: ArithmeticOperator
-> ArithmeticOperator -> ArithmeticOperator -> [ArithmeticOperator]
Enum, ArithmeticOperator
ArithmeticOperator
-> ArithmeticOperator -> Bounded ArithmeticOperator
forall a. a -> a -> Bounded a
$cminBound :: ArithmeticOperator
minBound :: ArithmeticOperator
$cmaxBound :: ArithmeticOperator
maxBound :: ArithmeticOperator
Bounded)
data ComparisonOperator
=
EqOp
|
NeOp
|
LtOp
|
LeOp
|
GtOp
|
GeOp
deriving (Int -> ComparisonOperator -> ShowS
[ComparisonOperator] -> ShowS
ComparisonOperator -> String
(Int -> ComparisonOperator -> ShowS)
-> (ComparisonOperator -> String)
-> ([ComparisonOperator] -> ShowS)
-> Show ComparisonOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ComparisonOperator -> ShowS
showsPrec :: Int -> ComparisonOperator -> ShowS
$cshow :: ComparisonOperator -> String
show :: ComparisonOperator -> String
$cshowList :: [ComparisonOperator] -> ShowS
showList :: [ComparisonOperator] -> ShowS
Show, ComparisonOperator -> ComparisonOperator -> Bool
(ComparisonOperator -> ComparisonOperator -> Bool)
-> (ComparisonOperator -> ComparisonOperator -> Bool)
-> Eq ComparisonOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ComparisonOperator -> ComparisonOperator -> Bool
== :: ComparisonOperator -> ComparisonOperator -> Bool
$c/= :: ComparisonOperator -> ComparisonOperator -> Bool
/= :: ComparisonOperator -> ComparisonOperator -> Bool
Eq, Int -> ComparisonOperator
ComparisonOperator -> Int
ComparisonOperator -> [ComparisonOperator]
ComparisonOperator -> ComparisonOperator
ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
ComparisonOperator
-> ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
(ComparisonOperator -> ComparisonOperator)
-> (ComparisonOperator -> ComparisonOperator)
-> (Int -> ComparisonOperator)
-> (ComparisonOperator -> Int)
-> (ComparisonOperator -> [ComparisonOperator])
-> (ComparisonOperator
-> ComparisonOperator -> [ComparisonOperator])
-> (ComparisonOperator
-> ComparisonOperator -> [ComparisonOperator])
-> (ComparisonOperator
-> ComparisonOperator
-> ComparisonOperator
-> [ComparisonOperator])
-> Enum ComparisonOperator
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ComparisonOperator -> ComparisonOperator
succ :: ComparisonOperator -> ComparisonOperator
$cpred :: ComparisonOperator -> ComparisonOperator
pred :: ComparisonOperator -> ComparisonOperator
$ctoEnum :: Int -> ComparisonOperator
toEnum :: Int -> ComparisonOperator
$cfromEnum :: ComparisonOperator -> Int
fromEnum :: ComparisonOperator -> Int
$cenumFrom :: ComparisonOperator -> [ComparisonOperator]
enumFrom :: ComparisonOperator -> [ComparisonOperator]
$cenumFromThen :: ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
enumFromThen :: ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
$cenumFromTo :: ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
enumFromTo :: ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
$cenumFromThenTo :: ComparisonOperator
-> ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
enumFromThenTo :: ComparisonOperator
-> ComparisonOperator -> ComparisonOperator -> [ComparisonOperator]
Enum, ComparisonOperator
ComparisonOperator
-> ComparisonOperator -> Bounded ComparisonOperator
forall a. a -> a -> Bounded a
$cminBound :: ComparisonOperator
minBound :: ComparisonOperator
$cmaxBound :: ComparisonOperator
maxBound :: ComparisonOperator
Bounded)
type IsRec = Bool
data Type
=
TUnit
|
TBool
|
TInt
|
TFun Type Type
deriving (Int -> Type -> ShowS
[Type] -> ShowS
Type -> String
(Int -> Type -> ShowS)
-> (Type -> String) -> ([Type] -> ShowS) -> Show Type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Type -> ShowS
showsPrec :: Int -> Type -> ShowS
$cshow :: Type -> String
show :: Type -> String
$cshowList :: [Type] -> ShowS
showList :: [Type] -> ShowS
Show, Type -> Type -> Bool
(Type -> Type -> Bool) -> (Type -> Type -> Bool) -> Eq Type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Type -> Type -> Bool
== :: Type -> Type -> Bool
$c/= :: Type -> Type -> Bool
/= :: Type -> Type -> Bool
Eq, Eq Type
Eq Type
-> (Type -> Type -> Ordering)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Type)
-> (Type -> Type -> Type)
-> Ord Type
Type -> Type -> Bool
Type -> Type -> Ordering
Type -> Type -> Type
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Type -> Type -> Ordering
compare :: Type -> Type -> Ordering
$c< :: Type -> Type -> Bool
< :: Type -> Type -> Bool
$c<= :: Type -> Type -> Bool
<= :: Type -> Type -> Bool
$c> :: Type -> Type -> Bool
> :: Type -> Type -> Bool
$c>= :: Type -> Type -> Bool
>= :: Type -> Type -> Bool
$cmax :: Type -> Type -> Type
max :: Type -> Type -> Type
$cmin :: Type -> Type -> Type
min :: Type -> Type -> Type
Ord)
type Arity = Int
data PrimitiveValue
=
PrimValUnit
|
PrimValBool Bool
|
PrimValInt Int64
deriving (Int -> PrimitiveValue -> ShowS
[PrimitiveValue] -> ShowS
PrimitiveValue -> String
(Int -> PrimitiveValue -> ShowS)
-> (PrimitiveValue -> String)
-> ([PrimitiveValue] -> ShowS)
-> Show PrimitiveValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrimitiveValue -> ShowS
showsPrec :: Int -> PrimitiveValue -> ShowS
$cshow :: PrimitiveValue -> String
show :: PrimitiveValue -> String
$cshowList :: [PrimitiveValue] -> ShowS
showList :: [PrimitiveValue] -> ShowS
Show, PrimitiveValue -> PrimitiveValue -> Bool
(PrimitiveValue -> PrimitiveValue -> Bool)
-> (PrimitiveValue -> PrimitiveValue -> Bool) -> Eq PrimitiveValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PrimitiveValue -> PrimitiveValue -> Bool
== :: PrimitiveValue -> PrimitiveValue -> Bool
$c/= :: PrimitiveValue -> PrimitiveValue -> Bool
/= :: PrimitiveValue -> PrimitiveValue -> Bool
Eq)