syntax-tree-0.1.0.0: Typed ASTs

Safe HaskellNone
LanguageHaskell2010

AST.Combinator.Compose

Description

Compose two knots.

Inspired by hyperfunctions' @Category@ instance.

Synopsis

Documentation

newtype Compose a b k Source #

Compose two knots as an external and internal layer.

Constructors

MkCompose 

Fields

Instances
(Infer m t, KPointed (InferOf t), KTraversable (InferOf t)) => Infer m (Compose Prune t) Source # 
Instance details

Defined in AST.Knot.Prune

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

Defined in AST.Combinator.Compose

Associated Types

type KNodesConstraint (Compose a b) c :: Constraint Source #

data KWitness (Compose a b) a :: Type Source #

Methods

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

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

Defined in AST.Combinator.Compose

Methods

pureK :: (forall (n :: Knot -> Type). KWitness (Compose a b) n -> Tree p n) -> Tree (Compose a b) p Source #

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

Defined in AST.Combinator.Compose

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (Compose a b) n -> Tree p n -> Tree q n) -> Tree (Compose a b) p -> Tree (Compose a b) q Source #

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

Defined in AST.Combinator.Compose

Methods

zipK :: Tree (Compose a b) p -> Tree (Compose a b) q -> Tree (Compose a b) (Product p q) Source #

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

Defined in AST.Combinator.Compose

Methods

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

(ZipMatch k0, ZipMatch k1, KTraversable k0, KFunctor k1) => ZipMatch (Compose k0 k1) Source # 
Instance details

Defined in AST.Combinator.Compose

Methods

zipMatch :: Tree (Compose k0 k1) p -> Tree (Compose k0 k1) q -> Maybe (Tree (Compose k0 k1) (Product p q)) Source #

Constraints (Compose a b k) Eq => Eq (Compose a b k) Source # 
Instance details

Defined in AST.Combinator.Compose

Methods

(==) :: Compose a b k -> Compose a b k -> Bool #

(/=) :: Compose a b k -> Compose a b k -> Bool #

Constraints (Compose a b k) Ord => Ord (Compose a b k) Source # 
Instance details

Defined in AST.Combinator.Compose

Methods

compare :: Compose a b k -> Compose a b k -> Ordering #

(<) :: Compose a b k -> Compose a b k -> Bool #

(<=) :: Compose a b k -> Compose a b k -> Bool #

(>) :: Compose a b k -> Compose a b k -> Bool #

(>=) :: Compose a b k -> Compose a b k -> Bool #

max :: Compose a b k -> Compose a b k -> Compose a b k #

min :: Compose a b k -> Compose a b k -> Compose a b k #

Constraints (Compose a b k) Show => Show (Compose a b k) Source # 
Instance details

Defined in AST.Combinator.Compose

Methods

showsPrec :: Int -> Compose a b k -> ShowS #

show :: Compose a b k -> String #

showList :: [Compose a b k] -> ShowS #

Generic (Compose a b k) Source # 
Instance details

Defined in AST.Combinator.Compose

Associated Types

type Rep (Compose a b k) :: Type -> Type #

Methods

from :: Compose a b k -> Rep (Compose a b k) x #

to :: Rep (Compose a b k) x -> Compose a b k #

Constraints (Compose a b k) Binary => Binary (Compose a b k) Source # 
Instance details

Defined in AST.Combinator.Compose

Methods

put :: Compose a b k -> Put #

get :: Get (Compose a b k) #

putList :: [Compose a b k] -> Put #

Constraints (Compose a b k) NFData => NFData (Compose a b k) Source # 
Instance details

Defined in AST.Combinator.Compose

Methods

rnf :: Compose a b k -> () #

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

Defined in AST.Combinator.Compose

data KWitness (Compose a b) n where
type InferOf (Compose Prune t) Source # 
Instance details

Defined in AST.Knot.Prune

type KNodesConstraint (Compose a b) c Source # 
Instance details

Defined in AST.Combinator.Compose

type Rep (Compose a b k) Source # 
Instance details

Defined in AST.Combinator.Compose

type Rep (Compose a b k) = D1 (MetaData "Compose" "AST.Combinator.Compose" "syntax-tree-0.1.0.0-8tfou50n4eQ4Iq1dis9DWN" True) (C1 (MetaCons "MkCompose" PrefixI True) (S1 (MetaSel (Just "getCompose") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Tree a (Compose b (GetKnot k))))))

_Compose :: Iso (Tree (Compose a0 b0) k0) (Tree (Compose a1 b1) k1) (Tree a0 (Compose b0 k0)) (Tree a1 (Compose b1 k1)) Source #

An Iso for the Compose newtype