syntax-tree-0.1.0.0: Typed ASTs

Safe HaskellNone
LanguageHaskell2010

AST.Term.Row

Description

Row types

Synopsis

Documentation

class (Ord (RowConstraintsKey constraints), TypeConstraints constraints) => RowConstraints constraints where Source #

Associated Types

type RowConstraintsKey constraints Source #

Methods

forbidden :: Lens' constraints (Set (RowConstraintsKey constraints)) Source #

data RowExtend key val rest k Source #

Row-extend primitive for use in both value-level and type-level

Constructors

RowExtend 

Fields

Instances
KNodes (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Associated Types

type KNodesConstraint (RowExtend key val rest) c :: Constraint Source #

data KWitness (RowExtend key val rest) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (RowExtend key val rest) c => KWitness (RowExtend key val rest) n -> Proxy c -> (c n -> r) -> r Source #

Monoid key => KPointed (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

pureK :: (forall (n :: Knot -> Type). KWitness (RowExtend key val rest) n -> Tree p n) -> Tree (RowExtend key val rest) p Source #

KFunctor (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (RowExtend key val rest) n -> Tree p n -> Tree q n) -> Tree (RowExtend key val rest) p -> Tree (RowExtend key val rest) q Source #

Semigroup key => KApply (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

zipK :: Tree (RowExtend key val rest) p -> Tree (RowExtend key val rest) q -> Tree (RowExtend key val rest) (Product p q) Source #

KFoldable (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

foldMapK :: Monoid a => (forall (n :: Knot -> Type). KWitness (RowExtend key val rest) n -> Tree p n -> a) -> Tree (RowExtend key val rest) p -> a Source #

KTraversable (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

sequenceK :: Applicative f => Tree (RowExtend key val rest) (ContainedK f p) -> f (Tree (RowExtend key val rest) p) Source #

Eq key => ZipMatch (RowExtend key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

zipMatch :: Tree (RowExtend key val rest) p -> Tree (RowExtend key val rest) q -> Maybe (Tree (RowExtend key val rest) (Product p q)) Source #

Constraints (RowExtend key val rest k) Eq => Eq (RowExtend key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

(==) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool #

(/=) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool #

Constraints (RowExtend key val rest k) Ord => Ord (RowExtend key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

compare :: RowExtend key val rest k -> RowExtend key val rest k -> Ordering #

(<) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool #

(<=) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool #

(>) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool #

(>=) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool #

max :: RowExtend key val rest k -> RowExtend key val rest k -> RowExtend key val rest k #

min :: RowExtend key val rest k -> RowExtend key val rest k -> RowExtend key val rest k #

Constraints (RowExtend key val rest k) Show => Show (RowExtend key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

showsPrec :: Int -> RowExtend key val rest k -> ShowS #

show :: RowExtend key val rest k -> String #

showList :: [RowExtend key val rest k] -> ShowS #

Generic (RowExtend key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Associated Types

type Rep (RowExtend key val rest k) :: Type -> Type #

Methods

from :: RowExtend key val rest k -> Rep (RowExtend key val rest k) x #

to :: Rep (RowExtend key val rest k) x -> RowExtend key val rest k #

Constraints (RowExtend key val rest k) Binary => Binary (RowExtend key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

put :: RowExtend key val rest k -> Put #

get :: Get (RowExtend key val rest k) #

putList :: [RowExtend key val rest k] -> Put #

Constraints (RowExtend key val rest k) NFData => NFData (RowExtend key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

rnf :: RowExtend key val rest k -> () #

data KWitness (RowExtend key val rest) node Source # 
Instance details

Defined in AST.Term.Row

data KWitness (RowExtend key val rest) node where
type KNodesConstraint (RowExtend key val rest) constraint Source # 
Instance details

Defined in AST.Term.Row

type KNodesConstraint (RowExtend key val rest) constraint = (constraint val, constraint rest)
type Rep (RowExtend key val rest k) Source # 
Instance details

Defined in AST.Term.Row

type Rep (RowExtend key val rest k) = D1 (MetaData "RowExtend" "AST.Term.Row" "syntax-tree-0.1.0.0-8tfou50n4eQ4Iq1dis9DWN" False) (C1 (MetaCons "RowExtend" PrefixI True) (S1 (MetaSel (Just "_eKey") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 key) :*: (S1 (MetaSel (Just "_eVal") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # val)) :*: S1 (MetaSel (Just "_eRest") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # rest)))))

eKey :: forall key val rest k key. Lens (RowExtend key val rest k) (RowExtend key val rest k) key key Source #

eVal :: forall key val rest k val. Lens (RowExtend key val rest k) (RowExtend key val rest k) ((#) k val) ((#) k val) Source #

eRest :: forall key val rest k rest. Lens (RowExtend key val rest k) (RowExtend key val rest k) ((#) k rest) ((#) k rest) 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

data FlatRowExtends key val rest k Source #

Constructors

FlatRowExtends 

Fields

Instances
KNodes (FlatRowExtends key val rest) Source # 
Instance details

Defined in AST.Term.Row

Associated Types

type KNodesConstraint (FlatRowExtends key val rest) c :: Constraint Source #

data KWitness (FlatRowExtends key val rest) a :: Type Source #

Methods

kLiftConstraint :: KNodesConstraint (FlatRowExtends key val rest) c => KWitness (FlatRowExtends key val rest) n -> Proxy c -> (c n -> r) -> r Source #

Applicative (Map key) => KPointed (FlatRowExtends key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

pureK :: (forall (n :: Knot -> Type). KWitness (FlatRowExtends key val rest) n -> Tree p n) -> Tree (FlatRowExtends key val rest) p Source #

KFunctor (FlatRowExtends key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

mapK :: (forall (n :: Knot -> Type). KWitness (FlatRowExtends key val rest) n -> Tree p n -> Tree q n) -> Tree (FlatRowExtends key val rest) p -> Tree (FlatRowExtends key val rest) q Source #

Applicative (Map key) => KApply (FlatRowExtends key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

zipK :: Tree (FlatRowExtends key val rest) p -> Tree (FlatRowExtends key val rest) q -> Tree (FlatRowExtends key val rest) (Product p q) Source #

KFoldable (FlatRowExtends key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

foldMapK :: Monoid a => (forall (n :: Knot -> Type). KWitness (FlatRowExtends key val rest) n -> Tree p n -> a) -> Tree (FlatRowExtends key val rest) p -> a Source #

KTraversable (FlatRowExtends key val rest) Source # 
Instance details

Defined in AST.Term.Row

Methods

sequenceK :: Applicative f => Tree (FlatRowExtends key val rest) (ContainedK f p) -> f (Tree (FlatRowExtends key val rest) p) Source #

Constraints (FlatRowExtends key val rest k) Eq => Eq (FlatRowExtends key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

(==) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool #

(/=) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool #

Constraints (FlatRowExtends key val rest k) Ord => Ord (FlatRowExtends key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

compare :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Ordering #

(<) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool #

(<=) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool #

(>) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool #

(>=) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool #

max :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> FlatRowExtends key val rest k #

min :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> FlatRowExtends key val rest k #

Constraints (FlatRowExtends key val rest k) Show => Show (FlatRowExtends key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

showsPrec :: Int -> FlatRowExtends key val rest k -> ShowS #

show :: FlatRowExtends key val rest k -> String #

showList :: [FlatRowExtends key val rest k] -> ShowS #

Generic (FlatRowExtends key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Associated Types

type Rep (FlatRowExtends key val rest k) :: Type -> Type #

Methods

from :: FlatRowExtends key val rest k -> Rep (FlatRowExtends key val rest k) x #

to :: Rep (FlatRowExtends key val rest k) x -> FlatRowExtends key val rest k #

Constraints (FlatRowExtends key val rest k) Binary => Binary (FlatRowExtends key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

put :: FlatRowExtends key val rest k -> Put #

get :: Get (FlatRowExtends key val rest k) #

putList :: [FlatRowExtends key val rest k] -> Put #

Constraints (FlatRowExtends key val rest k) NFData => NFData (FlatRowExtends key val rest k) Source # 
Instance details

Defined in AST.Term.Row

Methods

rnf :: FlatRowExtends key val rest k -> () #

data KWitness (FlatRowExtends key val rest) node Source # 
Instance details

Defined in AST.Term.Row

data KWitness (FlatRowExtends key val rest) node where
type KNodesConstraint (FlatRowExtends key val rest) constraint Source # 
Instance details

Defined in AST.Term.Row

type KNodesConstraint (FlatRowExtends key val rest) constraint = (constraint val, constraint rest)
type Rep (FlatRowExtends key val rest k) Source # 
Instance details

Defined in AST.Term.Row

type Rep (FlatRowExtends key val rest k) = D1 (MetaData "FlatRowExtends" "AST.Term.Row" "syntax-tree-0.1.0.0-8tfou50n4eQ4Iq1dis9DWN" False) (C1 (MetaCons "FlatRowExtends" PrefixI True) (S1 (MetaSel (Just "_freExtends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map key (k # val))) :*: S1 (MetaSel (Just "_freRest") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # rest))))

freExtends :: forall key val rest k key val. Lens (FlatRowExtends key val rest k) (FlatRowExtends key val rest k) (Map key ((#) k val)) (Map key ((#) k val)) Source #

freRest :: forall key val rest k rest. Lens (FlatRowExtends key val rest k) (FlatRowExtends key val rest k) ((#) k rest) ((#) k rest) Source #

flattenRow :: (Ord key, Monad m) => (Tree v rest -> m (Maybe (Tree (RowExtend key val rest) v))) -> Tree v rest -> m (Tree (FlatRowExtends key val rest) v) Source #

flattenRowExtend :: (Ord key, Monad m) => (Tree v rest -> m (Maybe (Tree (RowExtend key val rest) v))) -> Tree (RowExtend key val rest) v -> m (Tree (FlatRowExtends key val rest) v) Source #

unflattenRow :: Monad m => (Tree (RowExtend key val rest) v -> m (Tree v rest)) -> Tree (FlatRowExtends key val rest) v -> m (Tree v rest) Source #

verifyRowExtendConstraints :: RowConstraints (TypeConstraintsOf rowTyp) => (TypeConstraintsOf rowTyp -> TypeConstraintsOf valTyp) -> TypeConstraintsOf rowTyp -> Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) k -> Maybe (Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) (WithConstraint k)) Source #

rowExtendStructureMismatch :: Ord key => (Unify m rowTyp, Unify m valTyp) => (forall c. Unify m c => Tree (UVarOf m) c -> Tree (UVarOf m) c -> m (Tree (UVarOf m) c)) -> Prism' (Tree rowTyp (UVarOf m)) (Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> (TypeConstraintsOf rowTyp, Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> (TypeConstraintsOf rowTyp, Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> m () Source #

rowElementInfer :: (Unify m valTyp, Unify m rowTyp, RowConstraints (TypeConstraintsOf rowTyp)) => (Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) (UVarOf m) -> Tree rowTyp (UVarOf m)) -> RowKey rowTyp -> m (Tree (UVarOf m) valTyp, Tree (UVarOf m) rowTyp) Source #