Safe Haskell | None |
---|---|
Language | Haskell2010 |
Main module for the library
- lexATS :: String -> [Token]
- parseATS :: [Token] -> Either (ATSError String) ATS
- printATS :: ATS -> String
- newtype ATS = ATS {
- unATS :: [Declaration]
- data Declaration
- = Func AlexPosn Function
- | Impl [Arg] Implementation
- | ProofImpl Implementation
- | Val Addendum (Maybe Type) Pattern Expression
- | PrVal Pattern Expression
- | Var (Maybe Type) Pattern (Maybe Expression)
- | AndDecl (Maybe Type) Pattern Expression
- | Include String
- | Staload (Maybe String) String
- | Stadef String Name
- | CBlock String
- | RecordType String [Arg] [(String, Type)]
- | RecordViewType String [Arg] [(String, Type)]
- | TypeDef AlexPosn String [Arg] Type
- | ViewTypeDef AlexPosn String [Arg] Type
- | SumType String [Arg] [(String, Maybe Type)]
- | SumViewType String [Arg] [(String, Maybe Type)]
- | AbsType AlexPosn String [Arg] Type
- | AbsViewType AlexPosn String [Arg] Type
- | OverloadOp AlexPosn BinOp Name
- | Comment String
- | DataProp AlexPosn String [Arg] [DataPropLeaf]
- | Extern AlexPosn Declaration
- | Define String
- | SortDef AlexPosn String Type
- | AndD Declaration Declaration
- | Local AlexPosn [Declaration] [Declaration]
- | AbsProp AlexPosn String [Arg]
- | Assume Name [Arg] Expression
- data Expression
- = Let AlexPosn ATS (Maybe Expression)
- | VoidLiteral AlexPosn
- | Call Name [Expression] [Type] (Maybe Expression) [Expression]
- | NamedVal Name
- | If { }
- | Sif { }
- | BoolLit Bool
- | TimeLit String
- | FloatLit Float
- | IntLit Int
- | UnderscoreLit AlexPosn
- | Lambda AlexPosn LambdaType Pattern Expression
- | LinearLambda AlexPosn LambdaType Pattern Expression
- | Index AlexPosn Name Expression
- | Access AlexPosn Expression Name
- | StringLit String
- | CharLit Char
- | AtExpr Expression Expression
- | Binary BinOp Expression Expression
- | BinList {
- _op :: BinOp
- _exprs :: [Expression]
- | Unary UnOp Expression
- | Case {
- posE :: AlexPosn
- kind :: Addendum
- val :: Expression
- arms :: [(Pattern, Expression)]
- | RecordValue AlexPosn [(String, Expression)] (Maybe Type)
- | Precede Expression Expression
- | FieldMutate {
- posE :: AlexPosn
- old :: Expression
- field :: String
- new :: Expression
- | Mutate Expression Expression
- | Deref AlexPosn Expression
- | Ref AlexPosn Type Expression
- | ProofExpr AlexPosn Expression Expression
- | TypeSignature Expression Type
- | WhereExp Expression [Declaration]
- | TupleEx AlexPosn [Expression]
- | While AlexPosn Expression Expression
- | Actions ATS
- | TKind AlexPosn Name String
- | ViewExpr AlexPosn Type
- | Begin AlexPosn Expression
- data Type
- = Bool
- | Void
- | String
- | Char
- | Int
- | Nat
- | DependentInt Expression
- | DependentBool Expression
- | DepString Expression
- | Double
- | Float
- | Tuple AlexPosn [Type]
- | Named String
- | Ex Existential Type
- | ForA Universal Type
- | Dependent Name [Type]
- | Unconsumed Type
- | AsProof Type (Maybe Type)
- | FromVT Type
- | MaybeVal Type
- | T0p Addendum
- | Vt0p Addendum
- | At AlexPosn Type Type
- | ProofType AlexPosn Type Type
- | ConcreteType Expression
- | RefType Type
- | ViewType AlexPosn Type
- | FunctionType String Type Type
- exec :: IO ()
Functions
lexATS :: String -> [Token] Source #
This function turns a string into a stream of tokens for the parser.
Types
Newtype wrapper containing a list of declarations
ATS | |
|
data Declaration Source #
Declare something in a scope (a function, value, action, etc.)
Func AlexPosn Function | |
Impl [Arg] Implementation | |
ProofImpl Implementation | |
Val Addendum (Maybe Type) Pattern Expression | |
PrVal Pattern Expression | |
Var (Maybe Type) Pattern (Maybe Expression) | |
AndDecl (Maybe Type) Pattern Expression | |
Include String | |
Staload (Maybe String) String | |
Stadef String Name | |
CBlock String | |
RecordType String [Arg] [(String, Type)] | |
RecordViewType String [Arg] [(String, Type)] | |
TypeDef AlexPosn String [Arg] Type | |
ViewTypeDef AlexPosn String [Arg] Type | |
SumType String [Arg] [(String, Maybe Type)] | |
SumViewType String [Arg] [(String, Maybe Type)] | |
AbsType AlexPosn String [Arg] Type | |
AbsViewType AlexPosn String [Arg] Type | |
OverloadOp AlexPosn BinOp Name | |
Comment String | |
DataProp AlexPosn String [Arg] [DataPropLeaf] | |
Extern AlexPosn Declaration | |
Define String | |
SortDef AlexPosn String Type | |
AndD Declaration Declaration | |
Local AlexPosn [Declaration] [Declaration] | |
AbsProp AlexPosn String [Arg] | |
Assume Name [Arg] Expression |
data Expression Source #
A (possibly effectful) expression.
A type for parsed ATS types
Bool | |
Void | |
String | |
Char | |
Int | |
Nat | |
DependentInt Expression | |
DependentBool Expression | |
DepString Expression | |
Double | |
Float | |
Tuple AlexPosn [Type] | |
Named String | |
Ex Existential Type | |
ForA Universal Type | |
Dependent Name [Type] | |
Unconsumed Type | |
AsProof Type (Maybe Type) | |
FromVT Type | |
MaybeVal Type | |
T0p Addendum | |
Vt0p Addendum | |
At AlexPosn Type Type | |
ProofType AlexPosn Type Type | |
ConcreteType Expression | |
RefType Type | |
ViewType AlexPosn Type | |
FunctionType String Type Type |