module Database.Ferry.Core.Data.Core where
import Database.Ferry.Common.Data.Base
type Ident = String
data Op where
Op :: String -> Op
data CoreExpr where
BinOp :: Op -> CoreExpr -> CoreExpr -> CoreExpr
Constant :: Const -> CoreExpr
Var :: String -> CoreExpr
App :: CoreExpr -> Param -> CoreExpr
Let :: String -> CoreExpr -> CoreExpr -> CoreExpr
Rec :: [RecElem] -> CoreExpr
Cons :: CoreExpr -> CoreExpr -> CoreExpr
Nil :: CoreExpr
Elem :: CoreExpr -> String -> CoreExpr
Table :: String -> [Column] -> [Key] -> CoreExpr
If :: CoreExpr -> CoreExpr -> CoreExpr -> CoreExpr
data RecElem where
RecElem :: String -> CoreExpr -> RecElem
data Param where
ParExpr :: CoreExpr -> Param
ParAbstr :: [String] -> CoreExpr -> Param
data Column where
Column :: String -> Type -> Column
data Type
= TInt
| TFloat
| TString
| TBool
| TUnit
data Key where
Key :: [String] -> Key