syntax-tree-0.1.0.0: Typed ASTs

Safe HaskellSafe
LanguageHaskell2010

AST.Combinator.Flip

Description

A combinator to flip the order of the last two type parameters of a Knot.

Synopsis

Documentation

newtype Flip f x k Source #

Flip the order of the last two type parameters of a Knot.

Useful to use instances of classes such as KTraversable which are available on the flipped knot. For example GTerm has instances when flipped.

Constructors

MkFlip (Tree (f (GetKnot k)) x) 
Instances
RNodes a => KNodes (Flip GTerm a) Source # 
Instance details

Defined in AST.Unify.Generalize

Associated Types

type KNodesConstraint (Flip GTerm a) c :: Constraint Source #

data KWitness (Flip GTerm a) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (Flip GTerm a) c => KWitness (Flip GTerm a) n -> Proxy c -> (c n -> r) -> r Source #

KNodes (Flip (ITerm a) e) Source # 
Instance details

Defined in AST.Infer.Term

Associated Types

type KNodesConstraint (Flip (ITerm a) e) c :: Constraint Source #

data KWitness (Flip (ITerm a) e) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (Flip (ITerm a) e) c => KWitness (Flip (ITerm a) e) n -> Proxy c -> (c n -> r) -> r Source #

KNodes (Flip (BTerm a) e) Source # 
Instance details

Defined in AST.Infer.Blame

Associated Types

type KNodesConstraint (Flip (BTerm a) e) c :: Constraint Source #

data KWitness (Flip (BTerm a) e) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (Flip (BTerm a) e) c => KWitness (Flip (BTerm a) e) n -> Proxy c -> (c n -> r) -> r Source #

Recursively KFunctor ast => KFunctor (Flip GTerm ast) Source # 
Instance details

Defined in AST.Unify.Generalize

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (Flip GTerm ast) n -> Tree p n -> Tree q n) -> Tree (Flip GTerm ast) p -> Tree (Flip GTerm ast) q Source #

(Recursively KFunctor e, Recursively KFunctorInferOf e) => KFunctor (Flip (ITerm a) e) Source # 
Instance details

Defined in AST.Infer.Term

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (Flip (ITerm a) e) n -> Tree p n -> Tree q n) -> Tree (Flip (ITerm a) e) p -> Tree (Flip (ITerm a) e) q Source #

(Recursively KFunctor e, Recursively KFunctorInferOf e) => KFunctor (Flip (BTerm a) e) Source # 
Instance details

Defined in AST.Infer.Blame

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (Flip (BTerm a) e) n -> Tree p n -> Tree q n) -> Tree (Flip (BTerm a) e) p -> Tree (Flip (BTerm a) e) q Source #

Recursively KFoldable ast => KFoldable (Flip GTerm ast) Source # 
Instance details

Defined in AST.Unify.Generalize

Methods

foldMapK :: Monoid a => (forall (n :: Knot -> Type). KWitness (Flip GTerm ast) n -> Tree p n -> a) -> Tree (Flip GTerm ast) p -> a Source #

(Recursively KFoldable e, Recursively KFoldableInferOf e) => KFoldable (Flip (ITerm a) e) Source # 
Instance details

Defined in AST.Infer.Term

Methods

foldMapK :: Monoid a0 => (forall (n :: Knot -> Type). KWitness (Flip (ITerm a) e) n -> Tree p n -> a0) -> Tree (Flip (ITerm a) e) p -> a0 Source #

(Recursively KFoldable e, Recursively KFoldableInferOf e) => KFoldable (Flip (BTerm a) e) Source # 
Instance details

Defined in AST.Infer.Blame

Methods

foldMapK :: Monoid a0 => (forall (n :: Knot -> Type). KWitness (Flip (BTerm a) e) n -> Tree p n -> a0) -> Tree (Flip (BTerm a) e) p -> a0 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 #

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
type KNodesConstraint (Flip GTerm a) c Source # 
Instance details

Defined in AST.Unify.Generalize

type KNodesConstraint (Flip GTerm a) c = (c a, Recursive c)
type KNodesConstraint (Flip (ITerm a) e) c Source # 
Instance details

Defined in AST.Infer.Term

type KNodesConstraint (Flip (BTerm a) e) c Source # 
Instance details

Defined in AST.Infer.Blame

_Flip :: Iso (Tree (Flip f0 x0) k0) (Tree (Flip f1 x1) k1) (Tree (f0 k0) x0) (Tree (f1 k1) x1) Source #

An Iso from Flip to its content.

Using _Flip rather than the MkFlip data constructor is recommended, because it helps the type inference know that ANode c is parameterized with a Knot.