syntax-tree-0.1.0.1: Typed ASTs

Safe HaskellNone
LanguageHaskell2010

AST.Term.Var

Description

Variables.

Synopsis

Documentation

newtype Var v (expr :: Knot -> *) (k :: Knot) Source #

Parameterized by term AST and not by its type AST (which currently is its only part used), for future evaluation/complilation support.

Constructors

Var v 
Instances
(Unify m (TypeOf expr), HasScope m (ScopeOf expr), VarType v expr, Monad m) => Infer m (Var v expr) Source # 
Instance details

Defined in AST.Term.Var

Methods

inferBody :: Tree (Var v expr) (InferChild m k) -> m (Tree (Var v expr) k, Tree (InferOf (Var v expr)) (UVarOf m)) Source #

inferContext :: Proxy m -> Proxy (Var v expr) -> Dict (KNodesConstraint (Var v expr) (Infer m), KNodesConstraint (InferOf (Var v expr)) (Unify m)) Source #

KNodes (Var v expr) Source # 
Instance details

Defined in AST.Term.Var

Associated Types

type KNodesConstraint (Var v expr) c :: Constraint Source #

data KWitness (Var v expr) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (Var v expr) c => KWitness (Var v expr) n -> Proxy c -> (c n -> r) -> r Source #

Monoid v => KPointed (Var v expr) Source # 
Instance details

Defined in AST.Term.Var

Methods

pureK :: (forall (n :: Knot -> Type). KWitness (Var v expr) n -> Tree p n) -> Tree (Var v expr) p Source #

KFunctor (Var v expr) Source # 
Instance details

Defined in AST.Term.Var

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (Var v expr) n -> Tree p n -> Tree q n) -> Tree (Var v expr) p -> Tree (Var v expr) q Source #

Semigroup v => KApply (Var v expr) Source # 
Instance details

Defined in AST.Term.Var

Methods

zipK :: Tree (Var v expr) p -> Tree (Var v expr) q -> Tree (Var v expr) (Product p q) Source #

KFoldable (Var v expr) Source # 
Instance details

Defined in AST.Term.Var

Methods

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

Eq v => Eq (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

Methods

(==) :: Var v expr k -> Var v expr k -> Bool #

(/=) :: Var v expr k -> Var v expr k -> Bool #

Ord v => Ord (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

Methods

compare :: Var v expr k -> Var v expr k -> Ordering #

(<) :: Var v expr k -> Var v expr k -> Bool #

(<=) :: Var v expr k -> Var v expr k -> Bool #

(>) :: Var v expr k -> Var v expr k -> Bool #

(>=) :: Var v expr k -> Var v expr k -> Bool #

max :: Var v expr k -> Var v expr k -> Var v expr k #

min :: Var v expr k -> Var v expr k -> Var v expr k #

Show v => Show (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

Methods

showsPrec :: Int -> Var v expr k -> ShowS #

show :: Var v expr k -> String #

showList :: [Var v expr k] -> ShowS #

Generic (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

Associated Types

type Rep (Var v expr k) :: Type -> Type #

Methods

from :: Var v expr k -> Rep (Var v expr k) x #

to :: Rep (Var v expr k) x -> Var v expr k #

Binary v => Binary (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

Methods

put :: Var v expr k -> Put #

get :: Get (Var v expr k) #

putList :: [Var v expr k] -> Put #

NFData v => NFData (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

Methods

rnf :: Var v expr k -> () #

Pretty v => Pretty (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

Methods

pPrintPrec :: PrettyLevel -> Rational -> Var v expr k -> Doc #

pPrint :: Var v expr k -> Doc #

pPrintList :: PrettyLevel -> [Var v expr k] -> Doc #

data KWitness (Var v expr) node Source # 
Instance details

Defined in AST.Term.Var

data KWitness (Var v expr) node
type InferOf (Var v t) Source # 
Instance details

Defined in AST.Term.Var

type InferOf (Var v t) = ANode (TypeOf t)
type KNodesConstraint (Var v expr) constraint Source # 
Instance details

Defined in AST.Term.Var

type KNodesConstraint (Var v expr) constraint = ()
type Rep (Var v expr k) Source # 
Instance details

Defined in AST.Term.Var

type Rep (Var v expr k) = D1 (MetaData "Var" "AST.Term.Var" "syntax-tree-0.1.0.1-5Y9WhklreXaDnL6Q9tTtln" True) (C1 (MetaCons "Var" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 v)))

_Var :: forall v expr k v expr k. Iso (Var v expr k) (Var v expr k) v v Source #

class VarType var expr where Source #

Methods

varType :: Unify m (TypeOf expr) => Proxy expr -> var -> Tree (ScopeOf expr) (UVarOf m) -> m (Tree (UVarOf m) (TypeOf expr)) Source #

Instantiate a type for a variable in a given scope

type family ScopeOf (t :: Knot -> Type) :: Knot -> Type Source #

class HasScope m s where Source #

Methods

getScope :: m (Tree s (UVarOf m)) Source #