syntax-tree-0.1.0.0: Typed ASTs

Safe HaskellNone
LanguageHaskell2010

AST.Term.Let

Synopsis

Documentation

data Let v expr k Source #

A term for let-expressions with let-generalization.

Let v exprs express let-expressions with vs as variable names and exprs for terms.

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

Constructors

Let 

Fields

Instances
(MonadScopeLevel m, LocalScopeType v (Tree (GTerm (UVarOf m)) (TypeOf expr)) m, Unify m (TypeOf expr), HasInferredType expr, KNodesConstraint (InferOf expr) (Unify m), KTraversable (InferOf expr), Infer m expr) => Infer m (Let v expr) Source # 
Instance details

Defined in AST.Term.Let

Methods

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

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

KNodes (Let v expr) Source # 
Instance details

Defined in AST.Term.Let

Associated Types

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

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

Methods

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

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

Defined in AST.Term.Let

Methods

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

KFunctor (Let v expr) Source # 
Instance details

Defined in AST.Term.Let

Methods

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

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

Defined in AST.Term.Let

Methods

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

KFoldable (Let v expr) Source # 
Instance details

Defined in AST.Term.Let

Methods

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

KTraversable (Let v expr) Source # 
Instance details

Defined in AST.Term.Let

Methods

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

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

Defined in AST.Term.Let

Methods

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

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

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

Defined in AST.Term.Let

Methods

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

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

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

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

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

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

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

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

Defined in AST.Term.Let

Methods

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

show :: Let v expr k -> String #

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

Generic (Let v expr k) Source # 
Instance details

Defined in AST.Term.Let

Associated Types

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

Methods

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

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

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

Defined in AST.Term.Let

Methods

put :: Let v expr k -> Put #

get :: Get (Let v expr k) #

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

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

Defined in AST.Term.Let

Methods

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

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

Defined in AST.Term.Let

Methods

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

pPrint :: Let v expr k -> Doc #

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

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

Defined in AST.Term.Let

data KWitness (Let v expr) node where
type InferOf (Let v e) Source # 
Instance details

Defined in AST.Term.Let

type InferOf (Let v e) = InferOf e
type KNodesConstraint (Let v expr) constraint Source # 
Instance details

Defined in AST.Term.Let

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

Defined in AST.Term.Let

type Rep (Let v expr k) = D1 (MetaData "Let" "AST.Term.Let" "syntax-tree-0.1.0.0-8tfou50n4eQ4Iq1dis9DWN" False) (C1 (MetaCons "Let" PrefixI True) (S1 (MetaSel (Just "_letVar") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 v) :*: (S1 (MetaSel (Just "_letEquals") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # expr)) :*: S1 (MetaSel (Just "_letIn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # expr)))))

letVar :: forall v expr k v. Lens (Let v expr k) (Let v expr k) v v Source #

letEquals :: forall v expr k. Lens' (Let v expr k) ((#) k expr) Source #

letIn :: forall v expr k. Lens' (Let v expr k) ((#) 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