syntax-tree-0.1.0.0: Typed ASTs

Safe HaskellNone
LanguageHaskell2010

AST.Knot.Functor

Description

Functors as Knots

Synopsis

Documentation

newtype F f k Source #

Lift a Functor, or type constructor of kind Type -> Type to a Knot.

  • F Maybe can be used to encode structures with missing values
  • F (Either Text) can be used to encode results of parsing where structure components may fail to parse.

Constructors

F (f (k # F f)) 
Instances
c (F f) => Recursively c (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

recursively :: Proxy (c (F f)) -> Dict (c (F f), KNodesConstraint (F f) (Recursively c)) Source #

KNodes (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Associated Types

type KNodesConstraint (F f) c :: Constraint Source #

data KWitness (F f) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (F f) c => KWitness (F f) n -> Proxy c -> (c n -> r) -> r Source #

Applicative f => KPointed (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

pureK :: (forall (n :: Knot -> Type). KWitness (F f) n -> Tree p n) -> Tree (F f) p Source #

Functor f => KFunctor (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (F f) n -> Tree p n -> Tree q n) -> Tree (F f) p -> Tree (F f) q Source #

Applicative f => KApply (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

zipK :: Tree (F f) p -> Tree (F f) q -> Tree (F f) (Product p q) Source #

Foldable f => KFoldable (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

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

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

Defined in AST.Knot.Functor

RNodes (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Monad f => KMonad (F f) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

joinK :: Recursively KFunctor p => Tree (Compose (F f) (F f)) p -> Tree (F f) p Source #

Constraints (F f k) Eq => Eq (F f k) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

(==) :: F f k -> F f k -> Bool #

(/=) :: F f k -> F f k -> Bool #

Constraints (F f k) Ord => Ord (F f k) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

compare :: F f k -> F f k -> Ordering #

(<) :: F f k -> F f k -> Bool #

(<=) :: F f k -> F f k -> Bool #

(>) :: F f k -> F f k -> Bool #

(>=) :: F f k -> F f k -> Bool #

max :: F f k -> F f k -> F f k #

min :: F f k -> F f k -> F f k #

Constraints (F f k) Show => Show (F f k) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

showsPrec :: Int -> F f k -> ShowS #

show :: F f k -> String #

showList :: [F f k] -> ShowS #

Generic (F f k) Source # 
Instance details

Defined in AST.Knot.Functor

Associated Types

type Rep (F f k) :: Type -> Type #

Methods

from :: F f k -> Rep (F f k) x #

to :: Rep (F f k) x -> F f k #

Constraints (F f k) Binary => Binary (F f k) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

put :: F f k -> Put #

get :: Get (F f k) #

putList :: [F f k] -> Put #

Constraints (F f k) NFData => NFData (F f k) Source # 
Instance details

Defined in AST.Knot.Functor

Methods

rnf :: F f k -> () #

data KWitness (F f) node Source # 
Instance details

Defined in AST.Knot.Functor

data KWitness (F f) node where
type KNodesConstraint (F f) constraint Source # 
Instance details

Defined in AST.Knot.Functor

type KNodesConstraint (F f) constraint = constraint (F f)
type Rep (F f k) Source # 
Instance details

Defined in AST.Knot.Functor

type Rep (F f k) = D1 (MetaData "F" "AST.Knot.Functor" "syntax-tree-0.1.0.0-8tfou50n4eQ4Iq1dis9DWN" True) (C1 (MetaCons "F" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f (k # F f)))))

_F :: Iso (Tree (F f0) k0) (Tree (F f1) k1) (f0 (Tree k0 (F f0))) (f1 (Tree k1 (F f1))) Source #

An Iso from F to its content.

Using _F rather than the F data constructor is recommended, because it helps the type inference know that F f is parameterized with a Knot.

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