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.

Changes

0.1

  • Add acompare functiona and acompare' method to Alpha typeclass. (christiaanb)

    Handwritten Alpha instances will need to define this additional method now. Major version bump.

0.0.3

  • Add ‘name2Integer’ method (christiaanb)

  • Export internal type-directed gaeq, gopen, gclose, etc functions from Unbound.Generics.LocallyNameless.Alpha.

    Allows definitions like:

      instance Alpha Term where
        aeq' _ (Prim t1 _dk1) (Prim t2 _dk2) = t1 == t2
        aeq' c t1             t2             = gaeq c (from t1) (from t2)
    

0.0.2.1

  • Unconditionally add ErrorT and ExceptT instances using transformers-compat (bergmark)

0.0.2

  • Add ‘Rec’ pattern and ‘TRec’ term combinators.

  • Alpha instance for ‘()’

0.0.1

  • Add ‘lunbind2’ function.

  • Doc updates.

  • Switch from ‘HUnit’ to ‘Tasty’ for testing.

0.0.0.90

  • Initial (re-)implementation effort.