syntax-tree-0.1.0.1: Typed ASTs

Safe HaskellSafe
LanguageHaskell2010

AST.Class.Traversable

Description

A variant of Traversable for Knots

Synopsis

Documentation

class (KFunctor k, KFoldable k) => KTraversable k where Source #

A variant of Traversable for Knots

Methods

sequenceK :: Applicative f => Tree k (ContainedK f p) -> f (Tree k p) Source #

Instances
KTraversable Pure Source # 
Instance details

Defined in AST.Knot.Pure

Methods

sequenceK :: Applicative f => Tree Pure (ContainedK f p) -> f (Tree Pure p) Source #

KTraversable Prune Source # 
Instance details

Defined in AST.Knot.Prune

Methods

sequenceK :: Applicative f => Tree Prune (ContainedK f p) -> f (Tree Prune p) Source #

KTraversable (ANode c) Source # 
Instance details

Defined in AST.Combinator.ANode

Methods

sequenceK :: Applicative f => Tree (ANode c) (ContainedK f p) -> f (Tree (ANode c) p) Source #

Traversable f => KTraversable (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

sequenceK :: Applicative f0 => Tree (F f) (ContainedK f0 p) -> f0 (Tree (F f) p) Source #

KTraversable (Ann a) Source # 
Instance details

Defined in AST.Knot.Ann

Methods

sequenceK :: Applicative f => Tree (Ann a) (ContainedK f p) -> f (Tree (Ann a) p) Source #

KTraversable t => KTraversable (UnifyError t) Source # 
Instance details

Defined in AST.Unify.Error

Methods

sequenceK :: Applicative f => Tree (UnifyError t) (ContainedK f p) -> f (Tree (UnifyError t) p) Source #

KTraversable (FuncType typ) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

sequenceK :: Applicative f => Tree (FuncType typ) (ContainedK f p) -> f (Tree (FuncType typ) p) Source #

(RTraversable typ, KTraversable (NomVarTypes typ)) => KTraversable (LoadedNominalDecl typ) Source # 
Instance details

Defined in AST.Term.Nominal

KTraversable (NominalDecl typ) Source # 
Instance details

Defined in AST.Term.Nominal

Methods

sequenceK :: Applicative f => Tree (NominalDecl typ) (ContainedK f p) -> f (Tree (NominalDecl typ) p) Source #

KTraversable (App expr) Source # 
Instance details

Defined in AST.Term.App

Methods

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

KTraversable (ScopeTypes t) Source # 
Instance details

Defined in AST.Term.NamelessScope

Methods

sequenceK :: Applicative f => Tree (ScopeTypes t) (ContainedK f p) -> f (Tree (ScopeTypes t) p) Source #

KTraversable (Const a :: Knot -> Type) Source # 
Instance details

Defined in AST.Class.Traversable

Methods

sequenceK :: Applicative f => Tree (Const a) (ContainedK f p) -> f (Tree (Const a) p) Source #

RTraversable ast => KTraversable (Flip GTerm ast) Source # 
Instance details

Defined in AST.Unify.Generalize

Methods

sequenceK :: Applicative f => Tree (Flip GTerm ast) (ContainedK f p) -> f (Tree (Flip GTerm ast) p) Source #

(RTraversable e, RTraversableInferOf e) => KTraversable (Flip (ITerm a) e) Source # 
Instance details

Defined in AST.Infer.Term

Methods

sequenceK :: Applicative f => Tree (Flip (ITerm a) e) (ContainedK f p) -> f (Tree (Flip (ITerm a) e) p) Source #

(RTraversable e, RTraversableInferOf e) => KTraversable (Flip (BTerm a) e) Source # 
Instance details

Defined in AST.Infer.Blame

Methods

sequenceK :: Applicative f => Tree (Flip (BTerm a) e) (ContainedK f p) -> f (Tree (Flip (BTerm a) e) p) Source #

(KTraversable a, KTraversable b) => KTraversable (Compose a b) Source # 
Instance details

Defined in AST.Combinator.Compose

Methods

sequenceK :: Applicative f => Tree (Compose a b) (ContainedK f p) -> f (Tree (Compose a b) p) Source #

KTraversable (TermMap k expr) Source # 
Instance details

Defined in AST.Term.Map

Methods

sequenceK :: Applicative f => Tree (TermMap k expr) (ContainedK f p) -> f (Tree (TermMap k expr) p) Source #

KTraversable (Var v expr) Source # 
Instance details

Defined in AST.Term.Var

Methods

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

KTraversable (Scheme varTypes typ) Source # 
Instance details

Defined in AST.Term.Scheme

Methods

sequenceK :: Applicative f => Tree (Scheme varTypes typ) (ContainedK f p) -> f (Tree (Scheme varTypes typ) p) Source #

KTraversable (TypeSig vars term) Source # 
Instance details

Defined in AST.Term.TypeSig

Methods

sequenceK :: Applicative f => Tree (TypeSig vars term) (ContainedK f p) -> f (Tree (TypeSig vars term) p) Source #

KTraversable (FromNom nomId term) Source # 
Instance details

Defined in AST.Term.Nominal

Methods

sequenceK :: Applicative f => Tree (FromNom nomId term) (ContainedK f p) -> f (Tree (FromNom nomId term) p) Source #

KTraversable (ToNom nomId term) Source # 
Instance details

Defined in AST.Term.Nominal

Methods

sequenceK :: Applicative f => Tree (ToNom nomId term) (ContainedK f p) -> f (Tree (ToNom nomId term) p) Source #

KTraversable v => KTraversable (NominalInst n v) Source # 
Instance details

Defined in AST.Term.Nominal

Methods

sequenceK :: Applicative f => Tree (NominalInst n v) (ContainedK f p) -> f (Tree (NominalInst n v) p) 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 #

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 #

KTraversable (Scope expr a) Source # 
Instance details

Defined in AST.Term.NamelessScope

Methods

sequenceK :: Applicative f => Tree (Scope expr a) (ContainedK f p) -> f (Tree (Scope expr a) p) Source #

KTraversable (ScopeVar expr a) Source # 
Instance details

Defined in AST.Term.NamelessScope

Methods

sequenceK :: Applicative f => Tree (ScopeVar expr a) (ContainedK f p) -> f (Tree (ScopeVar expr a) p) Source #

(KTraversable a, KTraversable b) => KTraversable (Product a b) Source # 
Instance details

Defined in AST.Class.Traversable

Methods

sequenceK :: Applicative f => Tree (Product a b) (ContainedK f p) -> f (Tree (Product a b) p) Source #

(KTraversable a, KTraversable b) => KTraversable (Sum a b) Source # 
Instance details

Defined in AST.Class.Traversable

Methods

sequenceK :: Applicative f => Tree (Sum a b) (ContainedK f p) -> f (Tree (Sum a b) p) Source #

KTraversable (FlatRowExtends key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

sequenceK :: Applicative f => Tree (FlatRowExtends key val rest) (ContainedK f p) -> f (Tree (FlatRowExtends key val rest) p) Source #

KTraversable (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

sequenceK :: Applicative f => Tree (RowExtend key val rest) (ContainedK f p) -> f (Tree (RowExtend key val rest) p) Source #

KTraversable (TypedLam var typ expr) Source # 
Instance details

Defined in AST.Term.TypedLam

Methods

sequenceK :: Applicative f => Tree (TypedLam var typ expr) (ContainedK f p) -> f (Tree (TypedLam var typ expr) p) Source #

newtype ContainedK f p (k :: Knot) Source #

A Knot containing a tree inside an action.

Used to express sequenceK.

Constructors

MkContainedK 

Fields

_ContainedK :: Iso (Tree (ContainedK f0 p0) k0) (Tree (ContainedK f1 p1) k1) (f0 (Tree p0 k0)) (f1 (Tree p1 k1)) Source #

An Iso for the ContainedK newtype

traverseK :: (Applicative f, KTraversable k) => (forall n. KWitness k n -> Tree p n -> f (Tree q n)) -> Tree k p -> f (Tree k q) Source #

traverseK1 :: (KTraversable k, KNodesConstraint k ((~) n)) => Traversal (Tree k p) (Tree k q) (Tree p n) (Tree q n) Source #

KTraversable variant of traverse for Knots with a single node type.

It is a valid Traversal as it avoids using RankNTypes.