Copyright | (c) Murdoch J. Gabbay 2020 |
---|---|
License | GPL-3 |
Maintainer | murdoch.gabbay@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Typeclass for types that support a substitution action. Capture-avoidance is automatic, provided you used
or Nom
types for binding, of course. Abs
See Language.Nominal.Examples.SystemF for usage examples.
Substitution
class KSub n x y where Source #
Substitution. sub n x y
corresponds to "substitute the name n for the datum x in y".
We intend that n
should be a type of names KName k n
.
Nothing
Instances
KSub n x Char Source # | |
KSub n x () Source # | |
Defined in Language.Nominal.Sub | |
KSub n x Int Source # | |
KSub n x Bool Source # | |
KSub Var Exp Exp Source # | Substitution. Capture-avoidance is automatic. |
KSub NTrm Trm Trm Source # | Substitute term variable with term in term |
KSub NTyp Typ Trm Source # | |
KSub NTyp Typ NTrm Source # | Substitute type variables with type in term variable. Non-trivial because a term variable carries a label which contains a type. Action is functorial, descending into the type label. |
KSub NTyp Typ Typ Source # | Substitution acts on type variables. Capture-avoidance is automagical. |
KSub V Operand Prog Source # | Substitution on |
KSub V Operand Operand Source # | Substitution as standard on |
KSub V Operand Prog Source # | Substitution on |
KSub V Operand Operand Source # | Substitution as standard on |
KSub n x a => KSub n x (Maybe a) Source # | |
KSub n x a => KSub n x (NonEmpty a) Source # | |
KSub n x a => KSub n x [a] Source # | |
Defined in Language.Nominal.Sub | |
KSub n x (Nameless a) Source # | sub on nameless type is trivial |
(KSub n x a, KSub n x b) => KSub n x (Either a b) Source # | |
(KSub n x a, KSub n x b) => KSub n x (a, b) Source # | |
Defined in Language.Nominal.Sub | |
(KSub n x a, KSub n x b, KSub n x c) => KSub n x (a, b, c) Source # | |
Defined in Language.Nominal.Sub | |
(KSub n x a, KSub n x b, KSub n x c, KSub n x d) => KSub n x (a, b, c, d) Source # | |
Defined in Language.Nominal.Sub | |
(KSub n x a, KSub n x b, KSub n x c, KSub n x d, KSub n x e) => KSub n x (a, b, c, d, e) Source # | |
Defined in Language.Nominal.Sub | |
Eq n => KSub n ((n -> a) -> a) ((n -> a) -> a) Source # | Placeholder for future development. A general maths behind this definition is given in Section 8.1 of Definition 8.12 of Semantics Out Of Context (author's pdf). |
Defined in Language.Nominal.Sub | |
Eq n => KSub n ((n -> a) -> a) (n -> a) Source # | Placeholder for future development. A general maths behind this definition is given in Section 8.1 of Semantics Out Of Context (author's pdf). |
Defined in Language.Nominal.Sub | |
(Typeable s, Typeable u, KSub (KName s n) x t, KSub (KName s n) x y, Swappable t, Swappable y) => KSub (KName s n) x (KAbs (KName u t) y) Source # | sub on a nominal abstraction substitutes in the label, and substitutes capture-avoidingly in the body |
KSub (KName s n) (KName s n) (KName s n) Source # | sub on names |