unbound-generics: Support for programming with names and binders using GHC Generics

[ bsd3, language, library ] [ Propose Tags ]

Specify the binding structure of your data type with an expressive set of type combinators, and unbound-generics handles the rest! Automatically derives alpha-equivalence, free variable calculation, capture-avoiding substitution, and more. See Unbound.Generics.LocallyNameless to get started.

This is an independent re-implementation of Unbound but using GHC.Generics instead of RepLib. See the accompanying README for some porting notes.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0.90, 0.0.1, 0.0.2, 0.0.2.1, 0.0.3, 0.1, 0.1.2, 0.1.2.1, 0.2, 0.3, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4
Change log Changelog.md
Dependencies base (>=4.6 && <5), containers (>=0.5 && <0.6), contravariant (>=0.5), mtl (>=2.1), profunctors (>=4.0), template-haskell (>=2.8.0.0), transformers (>=0.3 && <0.6), transformers-compat (>=0.3) [details]
License BSD-3-Clause
Copyright (c) 2014-2015, Aleksey Kliger
Author Aleksey Kliger
Maintainer aleksey@lambdageek.org
Revised Revision 1 made by AndreasAbel at 2023-04-26T18:01:44Z
Category Language
Home page http://github.com/lambdageek/unbound-generics
Bug tracker http://github.com/lambdageek/unbound-generics/issues
Source repo head: git clone git://github.com/lambdageek/unbound-generics.git
Uploaded by AlekseyKliger at 2015-05-09T13:41:51Z
Distributions
Reverse Dependencies 7 direct, 8 indirect [details]
Downloads 13424 total (66 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-05-09 [all 1 reports]

Readme for unbound-generics-0.1.2.1

[back to package description]

unbound-generics

Build Status

This is a reimplementation of (parts of) unbound but using GHC generics instead of RepLib.

Differences from unbound

For the most part, I tried to keep the same methods with the same signatures. However there are a few differences.

  1. fv :: Alpha t => Fold t (Name n)

    The fv method returns a Fold (in the sense of the lens library), rather than an Unbound.Util.Collection instance. That means you will generally have to write toListOf fv t or some other summary operation.

  2. isPat :: Alpha t => t -> DisjointSet AnyName

    You should only notice this if you're implementing an instance of Alpha by hand (rather than by using the default generic instance). The original unbound returned a Maybe [AnyName] here with the same interpretation as DisjointSet: Nothing means an inconsistency was encountered, or Just the free variables of the pattern.

  3. embed :: IsEmbed e => Embedded e -> e and unembed :: IsEmbed e => e -> Embedded e

    The typeclass IsEmbed has an Iso (again in the sense of the lens library) as a method instead of the above pair of methods.

    Again, you should only notice this if you're implementing your own types that are instances of IsEmbed. The easiest thing to do is to use implement embedded = iso yourEmbed yourUnembed where iso comes from lens. (Although you can also implement it in terms of dimap if you don't want to depend on lens)