bricks-0.0.0.4: Bricks is a lazy functional language based on Nix.

Safe HaskellSafe
LanguageHaskell2010

Bricks.Term

Synopsis

Documentation

data Bottom Source #

Constructors

Bottom Text 

Instances

MonadError Bottom Eval # 

Methods

throwError :: Bottom -> Eval a #

catchError :: Eval a -> (Bottom -> Eval a) -> Eval a #

type Function = forall m. MonadEval m => Term -> m Term Source #

data Term Source #

Constructors

Term'Data Text Dynamic

The name of the data type, and a value of that type.

Term'Function Function 
Term'Lambda TermPattern Term

The head and body of a lambda expression.

Term'LetRec (Map Text Term) Term 
Term'List (Seq Term) 
Term'Dict (Seq (Term, Term)) 
Term'Dict'ReducedKeys (Map Text Term) 
Term'Var Text 
Term'Apply Term Term 
Term'Pointer TermPtr 

(/@\) :: Term -> Term -> Term infixl 9 Source #

Alias for Term'Apply. The name is an allusion to the AST depictions in The Implementation of Functional Programming Languages, where "f applied to x" is drawn as:

  @
 ╱ ╲
f   x

For a function of two parameters, see the corresponding /@@\ operator.

(/@@\) :: Term -> (Term, Term) -> Term infixl 9 Source #

Like /@\, but for a function applied to two arguments. Depicted as an abstract syntax tree, f /@@\ (x, y) looks like this:

    @
   ╱ ╲
  @   y
 ╱ ╲
f   x

(|->) :: TermPattern -> Term -> Term infixl 9 Source #

Alias for Term'Lambda.