4I0=      !"#$%&'()*+,-./0123456789:;<  Safe-InferredNone !"(9=HMTFirst order term views.v is the type of variables; o5 is the type of operators parameterized by arities; n: is the "higher type"/order of the term (i.e. a term has n=0, a single binding has n=1 , etc.); B is the functor which interprets the inner structure of the view.Views are a (higher) functor.a natural transformation  !  a view at  None None!"'9= Uniform variant of =, for indexed types. This is different from   p in that it is properly kind polymorphic and crucially heterogeneous, and it places no constraint on the index.      Safe-Inferred'9= Uniform variant of >, for indexed types. This is different from   ) in that it is properly kind polymorphic.      Safe-Inferred689Generates a fresh variable-Generates a fresh variable tagged with a nameNone!"(689= The t signature represents mediation between an arbitrary (possibly nameless) term representaion, and a simple one (the (). Based on the (effectful) ismorphism  /  between representations, many operations can be defined generically for arbitrary operator sets, including substitution and aggregation of free variables. Convert a  into a term.Convert a term into a simple .&The injection from variables to terms.Construct an abstraction.Construct an operator term.!Substitute a term for a variable.1Instantiate the bound variable of an abstraction.%Compute the free variables of a term.+Render a term into a human-readable string.    None !"(2469=T:First order terms (i.e. terms not headed by abstractions).)Locally nameless terms with operators in o at order n."JA variable is a De Bruijn index, optionally decorated with a display name.& A lens for $. varName "7 Lens' " (? @) ' A lens for %. varIndex "7 Lens' " A  !"#$%&'BCDEFGH  !"#$%&' ! "#$%&' ! "#$%&'BCDEFGH None None !"(23469BT (9A monad transformer for small step operational semantics.+^Next, we'll define the operators for a tiny lambda calculus as a datatype indexed by arities..oWe'll start off with a monad in which to manipulate ABTs; we'll need some state for fresh variable generation.1AWe'll run an ABT computation by starting the variable counter at 0.2*To indicate that a term is in normal form.3A single evaluation step.4GThe reflexive-transitive closure of a small-step operational semantics.5Evaluate a term to normal form6 x.x7  (x.x)(x.x)8<A demonstration of evaluating (and pretty-printing). Output: )ap[lam[@2.@2];lam[@3.@3]] ~>* lam[@2.@2] <6Check out the source to see fresh variable generation.()*+,-./0123456789:;<()*+,-./012345678./01<+-,;:()*29345678()*+-,./0123456789:;<I  !"#$%&'()*+,-.//012344567899:;<=>?@ABCDEFGHIJKLJMNJOPGQRSTUVWXYZ abt-0.1.0.1 Abt.Types.NatAbt.Types.ViewAbt.Class.HEq1Abt.Class.Show1Abt.Class.Monad Abt.Class.AbtAbt.Concrete.LocallyNameless Abt.Tutorial Abt.Types Data.FunctorEq1Show1 Abt.ClassNatSZView0View:$:\VmapViewHEq1=== $fHEq1[]Rec showsPrec1show1MonadVarfreshnamedAbtintooutvar\\$$subst//freeVarstoStringTm0TmAppAbsBoundFreeVar_varName _varIndexvarNamevarIndexStepTrunStepTLangApLamM_MrunMstepsExhaustedstepstareval identityTmappTmmain$fMonadVarVarStepT $fHEq1[]Lang $fShow1[]Lang$fMonadVarVarMghc-prim GHC.ClassesEqbaseGHC.ShowShow Data.MaybeMaybeGHC.BaseString GHC.TypesIntshiftVaraddVar $fAbtVaroTm $fHEq1NatTm$fOrdVar$fEqVar $fShowVar