syntax-tree-0.1.0.1: Typed ASTs

Safe HaskellNone
LanguageHaskell2010

AST.Term.FuncType

Synopsis

Documentation

data FuncType typ k Source #

A term for the types of functions. Analogues to (->) in Haskell.

FuncType typs express types of functions of typ.

The data type comes along with the HasFuncType class for code to be able to work for any type AST supporting the types of functions.

Constructors

FuncType 

Fields

Instances
KNodes (FuncType typ) Source # 
Instance details

Defined in AST.Term.FuncType

Associated Types

type KNodesConstraint (FuncType typ) c :: Constraint Source #

data KWitness (FuncType typ) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (FuncType typ) c => KWitness (FuncType typ) n -> Proxy c -> (c n -> r) -> r Source #

KPointed (FuncType typ) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

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

KFunctor (FuncType typ) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

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

KApply (FuncType typ) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

zipK :: Tree (FuncType typ) p -> Tree (FuncType typ) q -> Tree (FuncType typ) (Product p q) Source #

KFoldable (FuncType typ) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

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

ZipMatch (FuncType typ) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

zipMatch :: Tree (FuncType typ) p -> Tree (FuncType typ) q -> Maybe (Tree (FuncType typ) (Product p q)) Source #

Constraints (FuncType typ k) Eq => Eq (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

(==) :: FuncType typ k -> FuncType typ k -> Bool #

(/=) :: FuncType typ k -> FuncType typ k -> Bool #

Constraints (FuncType typ k) Ord => Ord (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

compare :: FuncType typ k -> FuncType typ k -> Ordering #

(<) :: FuncType typ k -> FuncType typ k -> Bool #

(<=) :: FuncType typ k -> FuncType typ k -> Bool #

(>) :: FuncType typ k -> FuncType typ k -> Bool #

(>=) :: FuncType typ k -> FuncType typ k -> Bool #

max :: FuncType typ k -> FuncType typ k -> FuncType typ k #

min :: FuncType typ k -> FuncType typ k -> FuncType typ k #

Show (k # typ) => Show (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

showsPrec :: Int -> FuncType typ k -> ShowS #

show :: FuncType typ k -> String #

showList :: [FuncType typ k] -> ShowS #

Generic (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

Associated Types

type Rep (FuncType typ k) :: Type -> Type #

Methods

from :: FuncType typ k -> Rep (FuncType typ k) x #

to :: Rep (FuncType typ k) x -> FuncType typ k #

Constraints (FuncType typ k) Binary => Binary (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

put :: FuncType typ k -> Put #

get :: Get (FuncType typ k) #

putList :: [FuncType typ k] -> Put #

Constraints (FuncType typ k) NFData => NFData (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

rnf :: FuncType typ k -> () #

Pretty (k # typ) => Pretty (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

Methods

pPrintPrec :: PrettyLevel -> Rational -> FuncType typ k -> Doc #

pPrint :: FuncType typ k -> Doc #

pPrintList :: PrettyLevel -> [FuncType typ k] -> Doc #

data KWitness (FuncType typ) node Source # 
Instance details

Defined in AST.Term.FuncType

data KWitness (FuncType typ) node where
type KNodesConstraint (FuncType typ) constraint Source # 
Instance details

Defined in AST.Term.FuncType

type KNodesConstraint (FuncType typ) constraint = constraint typ
type Rep (FuncType typ k) Source # 
Instance details

Defined in AST.Term.FuncType

type Rep (FuncType typ k) = D1 (MetaData "FuncType" "AST.Term.FuncType" "syntax-tree-0.1.0.1-5Y9WhklreXaDnL6Q9tTtln" False) (C1 (MetaCons "FuncType" PrefixI True) (S1 (MetaSel (Just "_funcIn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # typ)) :*: S1 (MetaSel (Just "_funcOut") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # typ))))

funcIn :: forall typ k. Lens' (FuncType typ k) ((#) k typ) Source #

funcOut :: forall typ k. Lens' (FuncType typ k) ((#) k typ) 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

class HasFuncType typ where Source #

HasFuncType is a class of Knots representing types that support the types of functions.

It is used by the Infer instances of App and Lam to work for any AST which provides HasFuncType.

Methods

funcType :: Prism' (Tree typ k) (Tree (FuncType typ) k) Source #