License | BSD-3-Clause |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Parser for terms of the Swarm language.
Synopsis
- parseDirection :: Parser Direction
- parseConst :: Parser Const
- parseTermAtom :: Parser Syntax
- parseTermAtom2 :: Parser Syntax
- sLet :: LetSyntax -> LocVar -> Maybe Polytype -> Syntax -> Syntax -> Term
- sNoop :: Syntax
- bindTydef :: [Var] -> Type -> Parser Polytype
- parseAntiquotation :: Parser Term
- parseTerm :: Parser Syntax
- mkBindChain :: [Stmt] -> Parser Syntax
- data Stmt
- parseStmt :: Parser Stmt
- mkStmt :: Maybe LocVar -> Syntax -> Stmt
- parseExpr :: Parser Syntax
- parseExpr' :: Parser Syntax
- binOps :: Map Int [Operator Parser Syntax]
- unOps :: Map Int [Operator Parser Syntax]
Documentation
>>>
import qualified Data.Map.Strict as M
parseDirection :: Parser Direction Source #
parseConst :: Parser Const Source #
Parse Const as reserved words (e.g. Fail <$ reserved "fail"
)
parseTermAtom :: Parser Syntax Source #
Parse an atomic term, optionally trailed by record projections like t.x.y.z
.
Record projection binds more tightly than function application.
parseTermAtom2 :: Parser Syntax Source #
Parse an atomic term.
sLet :: LetSyntax -> LocVar -> Maybe Polytype -> Syntax -> Syntax -> Term Source #
Construct an SLet
, automatically filling in the Boolean field
indicating whether it is recursive.
bindTydef :: [Var] -> Type -> Parser Polytype Source #
Create a polytype from a list of variable binders and a type. Ensure that no binder is repeated, and all type variables in the type are present in the list of binders (i.e. the type contains no free type variables).