symantic-6.0.0.20170623: Library for Typed Tagless-Final Higher-Order Composable DSL

Safe HaskellNone
LanguageHaskell2010

Language.Symantic.Transforming.Beta

Contents

Description

Interpreter to beta-reduce static lambdas introduced only because of the compiling machinery (hence preserving lambdas put by the user).

Synopsis

Type BetaT

data BetaT term a where Source #

The annotation here is if a lambda is known statically, and so can be applied if given an argument, Moreover, it only does this beta-reduction if the lambda has been introduced by the compiling phase (which happens when a symantic method is a function between terms instead of being only a term) (i.e. lam1 is used, not lam)

Constructors

BetaT_Unk :: term a -> BetaT term a 
BetaT_Lam1 :: (BetaT term a -> BetaT term b) -> BetaT term (a -> b) 

Instances

Sym_Lambda term => Trans (BetaT term) Source # 

Associated Types

type UnT (BetaT term :: * -> *) :: * -> * Source #

Methods

trans :: UnT (BetaT term) a -> BetaT term a Source #

unTrans :: BetaT term a -> UnT (BetaT term) a Source #

trans1 :: (UnT (BetaT term) a -> UnT (BetaT term) b) -> BetaT term a -> BetaT term b Source #

trans2 :: (UnT (BetaT term) a -> UnT (BetaT term) b -> UnT (BetaT term) c) -> BetaT term a -> BetaT term b -> BetaT term c Source #

trans3 :: (UnT (BetaT term) a -> UnT (BetaT term) b -> UnT (BetaT term) c -> UnT (BetaT term) d) -> BetaT term a -> BetaT term b -> BetaT term c -> BetaT term d Source #

Sym_Lambda term => Sym_Lambda (BetaT term) Source #

lam1 adds annotations, app uses it

Methods

apply :: BetaT term ((a -> b) -> a -> b) Source #

app :: BetaT term (a -> b) -> BetaT term a -> BetaT term b Source #

lam :: (BetaT term a -> BetaT term b) -> BetaT term (a -> b) Source #

let_ :: BetaT term var -> (BetaT term var -> BetaT term res) -> BetaT term res Source #

lam1 :: (BetaT term a -> BetaT term b) -> BetaT term (a -> b) Source #

qual :: proxy q -> BetaT term t -> BetaT term (q #> t) Source #

type UnT (BetaT term) Source # 
type UnT (BetaT term) = term

betaT :: Trans (BetaT term) => BetaT term a -> term a Source #

Transformer