syntax-tree-0.1.0.1: Typed ASTs

Safe HaskellNone
LanguageHaskell2010

AST.Term.Lam

Synopsis

Documentation

data Lam v expr k Source #

A term for lambda abstractions.

Lam v exprs express lambda abstractions with vs as variable names and exprs for bodies.

Apart from the data type, an Infer instance is also provided.

Constructors

Lam 

Fields

Instances
(Infer m t, Unify m (TypeOf t), HasInferredType t, LocalScopeType v (Tree (UVarOf m) (TypeOf t)) m) => Infer m (Lam v t) Source # 
Instance details

Defined in AST.Term.Lam

Methods

inferBody :: Tree (Lam v t) (InferChild m k) -> m (Tree (Lam v t) k, Tree (InferOf (Lam v t)) (UVarOf m)) Source #

inferContext :: Proxy m -> Proxy (Lam v t) -> Dict (KNodesConstraint (Lam v t) (Infer m), KNodesConstraint (InferOf (Lam v t)) (Unify m)) Source #

KNodes (Lam v expr) Source # 
Instance details

Defined in AST.Term.Lam

Associated Types

type KNodesConstraint (Lam v expr) c :: Constraint Source #

data KWitness (Lam v expr) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (Lam v expr) c => KWitness (Lam v expr) n -> Proxy c -> (c n -> r) -> r Source #

Monoid v => KPointed (Lam v expr) Source # 
Instance details

Defined in AST.Term.Lam

Methods

pureK :: (forall (n :: Knot -> Type). KWitness (Lam v expr) n -> Tree p n) -> Tree (Lam v expr) p Source #

KFunctor (Lam v expr) Source # 
Instance details

Defined in AST.Term.Lam

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (Lam v expr) n -> Tree p n -> Tree q n) -> Tree (Lam v expr) p -> Tree (Lam v expr) q Source #

Semigroup v => KApply (Lam v expr) Source # 
Instance details

Defined in AST.Term.Lam

Methods

zipK :: Tree (Lam v expr) p -> Tree (Lam v expr) q -> Tree (Lam v expr) (Product p q) Source #

KFoldable (Lam v expr) Source # 
Instance details

Defined in AST.Term.Lam

Methods

foldMapK :: Monoid a => (forall (n :: Knot -> Type). KWitness (Lam v expr) n -> Tree p n -> a) -> Tree (Lam v expr) p -> a Source #

KTraversable (Lam v expr) Source # 
Instance details

Defined in AST.Term.Lam

Methods

sequenceK :: Applicative f => Tree (Lam v expr) (ContainedK f p) -> f (Tree (Lam v expr) p) Source #

Constraints (Lam v expr k) Eq => Eq (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

Methods

(==) :: Lam v expr k -> Lam v expr k -> Bool #

(/=) :: Lam v expr k -> Lam v expr k -> Bool #

Constraints (Lam v expr k) Ord => Ord (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

Methods

compare :: Lam v expr k -> Lam v expr k -> Ordering #

(<) :: Lam v expr k -> Lam v expr k -> Bool #

(<=) :: Lam v expr k -> Lam v expr k -> Bool #

(>) :: Lam v expr k -> Lam v expr k -> Bool #

(>=) :: Lam v expr k -> Lam v expr k -> Bool #

max :: Lam v expr k -> Lam v expr k -> Lam v expr k #

min :: Lam v expr k -> Lam v expr k -> Lam v expr k #

Constraints (Lam v expr k) Show => Show (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

Methods

showsPrec :: Int -> Lam v expr k -> ShowS #

show :: Lam v expr k -> String #

showList :: [Lam v expr k] -> ShowS #

Generic (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

Associated Types

type Rep (Lam v expr k) :: Type -> Type #

Methods

from :: Lam v expr k -> Rep (Lam v expr k) x #

to :: Rep (Lam v expr k) x -> Lam v expr k #

Constraints (Lam v expr k) Binary => Binary (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

Methods

put :: Lam v expr k -> Put #

get :: Get (Lam v expr k) #

putList :: [Lam v expr k] -> Put #

Constraints (Lam v expr k) NFData => NFData (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

Methods

rnf :: Lam v expr k -> () #

Constraints (Lam v expr k) Pretty => Pretty (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

Methods

pPrintPrec :: PrettyLevel -> Rational -> Lam v expr k -> Doc #

pPrint :: Lam v expr k -> Doc #

pPrintList :: PrettyLevel -> [Lam v expr k] -> Doc #

data KWitness (Lam v expr) node Source # 
Instance details

Defined in AST.Term.Lam

data KWitness (Lam v expr) node where
type InferOf (Lam v t) Source # 
Instance details

Defined in AST.Term.Lam

type InferOf (Lam v t) = FuncType (TypeOf t)
type KNodesConstraint (Lam v expr) constraint Source # 
Instance details

Defined in AST.Term.Lam

type KNodesConstraint (Lam v expr) constraint = constraint expr
type Rep (Lam v expr k) Source # 
Instance details

Defined in AST.Term.Lam

type Rep (Lam v expr k) = D1 (MetaData "Lam" "AST.Term.Lam" "syntax-tree-0.1.0.1-5Y9WhklreXaDnL6Q9tTtln" False) (C1 (MetaCons "Lam" PrefixI True) (S1 (MetaSel (Just "_lamIn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 v) :*: S1 (MetaSel (Just "_lamOut") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # expr))))

lamIn :: forall v expr k v. Lens (Lam v expr k) (Lam v expr k) v v Source #

lamOut :: forall v expr k expr k. Lens (Lam v expr k) (Lam v expr k) ((#) k expr) ((#) k expr) Source #

data family KWitness k :: (Knot -> Type) -> Type Source #

KWitness k n is a witness that n is a node of k

Instances
data KWitness Pure node Source # 
Instance details

Defined in AST.Knot.Pure

data KWitness Pure node where
data KWitness Prune node Source # 
Instance details

Defined in AST.Knot.Prune

data KWitness Prune node where
data KWitness (ANode c) node Source # 
Instance details

Defined in AST.Combinator.ANode

data KWitness (ANode c) node where
data KWitness (F f) node Source # 
Instance details

Defined in AST.Knot.Functor

data KWitness (F f) node where
data KWitness (Ann a) node Source # 
Instance details

Defined in AST.Knot.Ann

data KWitness (Ann a) node where
data KWitness (UnifyError t) n Source # 
Instance details

Defined in AST.Unify.Error

data KWitness (UnifyError t) n where
data KWitness (FuncType typ) node Source # 
Instance details

Defined in AST.Term.FuncType

data KWitness (FuncType typ) node where
data KWitness (LoadedNominalDecl t) n Source # 
Instance details

Defined in AST.Term.Nominal

data KWitness (NominalDecl typ) node Source # 
Instance details

Defined in AST.Term.Nominal

data KWitness (App expr) node Source # 
Instance details

Defined in AST.Term.App

data KWitness (App expr) node where
data KWitness (ScopeTypes t) node Source # 
Instance details

Defined in AST.Term.NamelessScope

data KWitness (ScopeTypes t) node where
data KWitness (Const a :: Knot -> Type) i Source # 
Instance details

Defined in AST.Class.Nodes

data KWitness (Const a :: Knot -> Type) i
data KWitness (Flip GTerm a) n Source # 
Instance details

Defined in AST.Unify.Generalize

data KWitness (Flip (ITerm a) e) n Source # 
Instance details

Defined in AST.Infer.Term

data KWitness (Flip (ITerm a) e) n where
data KWitness (Flip (BTerm a) e) n Source # 
Instance details

Defined in AST.Infer.Blame

data KWitness (Flip (BTerm a) e) n where
data KWitness (Compose a b) n Source # 
Instance details

Defined in AST.Combinator.Compose

data KWitness (Compose a b) n where
data KWitness (TermMap k expr) node Source # 
Instance details

Defined in AST.Term.Map

data KWitness (TermMap k expr) node where
data KWitness (Var v expr) node Source # 
Instance details

Defined in AST.Term.Var

data KWitness (Var v expr) node
data KWitness (Scheme varTypes typ) node Source # 
Instance details

Defined in AST.Term.Scheme

data KWitness (Scheme varTypes typ) node where
data KWitness (TypeSig vars term) node Source # 
Instance details

Defined in AST.Term.TypeSig

data KWitness (TypeSig vars term) node where
data KWitness (FromNom nomId term) node Source # 
Instance details

Defined in AST.Term.Nominal

data KWitness (FromNom nomId term) node
data KWitness (ToNom nomId term) node Source # 
Instance details

Defined in AST.Term.Nominal

data KWitness (ToNom nomId term) node where
data KWitness (NominalInst n v) c Source # 
Instance details

Defined in AST.Term.Nominal

data KWitness (Let v expr) node Source # 
Instance details

Defined in AST.Term.Let

data KWitness (Let v expr) node where
data KWitness (Lam v expr) node Source # 
Instance details

Defined in AST.Term.Lam

data KWitness (Lam v expr) node where
data KWitness (Scope expr a) node Source # 
Instance details

Defined in AST.Term.NamelessScope

data KWitness (Scope expr a) node where
data KWitness (ScopeVar expr a) node Source # 
Instance details

Defined in AST.Term.NamelessScope

data KWitness (ScopeVar expr a) node
data KWitness (Product a b) n Source # 
Instance details

Defined in AST.Class.Nodes

data KWitness (Sum a b) n Source # 
Instance details

Defined in AST.Class.Nodes

data KWitness (Sum a b) n
data KWitness (FlatRowExtends key val rest) node Source # 
Instance details

Defined in AST.Term.Row

data KWitness (FlatRowExtends key val rest) node where
data KWitness (RowExtend key val rest) node Source # 
Instance details

Defined in AST.Term.Row

data KWitness (RowExtend key val rest) node where
data KWitness (TypedLam var typ expr) node Source # 
Instance details

Defined in AST.Term.TypedLam

data KWitness (TypedLam var typ expr) node where