Changelog History
Page 1

v0.4.1 Changes
May 11, 2020โ Add
MonadFail
instances forLFreshMT
andFreshMT
๐ Builds with GHC 8.10

v0.4.0 Changes
September 18, 2018 ๐ New binding specification type
Ignore
.
Any two
Ignore T
terms will always be alphaequivalent to each other, will be considered to contain no variables, and will not have any substitution apply beneathIgnore
. Useful for attaching annotation terms to your AST.import Text.Parsec.Pos (SourcePos) data Expr = ...  Lambda (Ignore SourcePos) (Bind (Name Expr) Expr)
As expected, any two
Lambda
expressions will be considered alphaequivalent even if they differ in source position.Note that the
Ignore
will block operations onName a
for alla
, which can be a little unexpected:data Ty = TyVar (Name Ty)  TyArr Ty Ty instance Subst Ty Ty where ... data Expr = ...  Var (Name Expr)  Lambda (Ignore Ty) (Bind (Name Expr) Expr) instance Subst Ty Expr
Applying a substitution of a type for a free type variable to a
Lambda
will not descend into theIgnore Ty
.Thanks Reed Mullanix (TOTWBF) for the new operation.
 ๐ Fix an issue in substitution where traversal would not continue in
an AST node for which
isvar
orisCoerceVar
is defined to return nonNothing
but which had additional structure.
For example, in a language with meta variables and explicit substitutions:
data Expr = ...  normal variables that stand for expressions  Var (Name Expr)  a meta variable occurrence and an explicit substitution  of expressions to substitute in for the free variables  MetaVar (Name Meta) [(Name Expr, Expr)]  a meta variable stands for an expression with some free term vars data Meta = MetaVar Expr  substitution for a meta in an expression instance Subst Expr Meta where isCoerceVar (MetaVar u sub) = Just (SubstCoerce u (Just . applyExplicitSubst sub)) applyExplicitSubst :: [(Name Expr, Expr)] > Meta > Expr applyExplicitSubst s (MetaVar e) = substs s e
Given an expression
e1
defined asMetaVar "u" [("x", 10)]
, we may want to substitute aMeta ("x" + "x")
for"u"
to get10 + 10
(that is, we replace"u"
by the expression"x" + "x"
and immediately apply the substitution10
for"x"
).Now suppose we have an expression
e2
defined asMetaVar "v" [("y", e1)]
(that is, an occurrence of meta var "v" together with a substitution ofe1
from above for"y"
). If we again try to substituteMeta ("x" + "x")
for"u"
ine2
, we would expect to getMetaVar "v" [("y", 10 + 10)]
(that is, since "v" is not equal to "u", we leave the meta var alone, but substitute for any occurrences of "u" in the explicit substitution, soe1
becomes10 + 10
as before).The bug in previous versions of
unboundgenerics
was that we would incorrectly leaveMetaVar "v" [("y", e1)]
unchanged as soon as we saw thatisCoerceVar (MetaVar "v" [("y", e1)])
returnedJust (SubstCoerce "u" ...)
where"u" /= "v"
.Thanks Reed Mullanix (TOTWBF) for finding and fixing this issue. https://github.com/lambdageek/unboundgenerics/issues/26
 ๐ New binding specification type

v0.3.4 Changes
September 17, 2018 โฌ๏ธ Bump
containers
upper bound to support0.6
. (GHC 8.6.1 support) Thanks Christiaan Baaij.
 โฌ๏ธ Bump

v0.3.3 Changes
May 11, 2018โฌ๏ธ Bump
exceptions
bound to>= 0.8 && < 0.11
to allowexceptions0.10.0

v0.3.2 Changes
March 09, 2018 โฌ๏ธ Bump
deepseq >= 1.4.0.0
remove benchmark dependency ondeepseqgenerics
๐ when building with GHC >= 7.10  โ Tested with GHC 8.4.1
 โ Tested with GHC 8.2.2
 Compile with
Wcompat
 โ Add
Semigroup
instances for all types that were previouslyMonoid
instances  โ Added more examples to the examples/ directory
 โ Added
exceptions
dependency andMonadThrow
,MonadCatch
,MonadMask
instances forFreshMT
andLFreshMT
.
 โฌ๏ธ Bump

v0.3.1 Changes
May 24, 2016 โ Tested with GHC 8.0.1
 โ Removed
Generic b
constraint fromSubst b (Name a)
instance.

v0.3 Changes
 โก๏ธ Change types of
open
andclose
to takeNthPatFind
andNamePatFind
instead of generic patterns, update call sites.  โ Add newtype wrappers and Monoid instances for
NthPatFind
andNamePatFind
 ๐ Change
isTerm
to returnAll
instead ofBool
 โก๏ธ Change types of

v0.2 Changes
August 01, 2015Incorporating some of the extras/oversights from clashlib Unbound.Generics.LocallyNameless.Extra
 Make
Embed
an instance ofOrd
NFData
instances (see below)
 Make
๐ Reimplement
freshen'
andgfreshen
using a free monad to give GHC a chance to inline it all away. This changes the type ofgfreshen
. Major version bump. Expose
FFM
,liftFFM
andretractFFM
 Expose
Provide
NFData
instances for all the combinators. Depend on 'deepseq'Start benchmarking some of the operations (particularly
unbind
).

v0.1.2 Changes
May 08, 2015 โ Added
Shift
type for lifting the scope of anEmbed
combinator up one binding level.  (in 0.1.1, which never went to Hackage) Added a
makeClosedAlpha
TH splice for making 'Alpha' instances for types that don't participate inAlpha
in a nontrivial way. A typeT
is trivial with respect toAlpha
if: it cannot contain any names
 thus its
aeq
is just(==)
 and
open
andclose
are both identity operations.
 โ Added

v0.1.2.1 Changes
 ๐ Fix ghc7.10 build.
 Haddock cleanup.