unbound-generics 0.1.2 → 0.1.2.1
raw patch · 6 files changed
+19/−11 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Changelog.md +5/−0
- src/Unbound/Generics/LocallyNameless.hs +1/−1
- src/Unbound/Generics/LocallyNameless/Embed.hs +4/−1
- src/Unbound/Generics/LocallyNameless/Operations.hs +3/−4
- src/Unbound/Generics/LocallyNameless/TH.hs +5/−4
- unbound-generics.cabal +1/−1
Changelog.md view
@@ -1,3 +1,8 @@+# 0.1.2.1++* Fix ghc-7.10 build.+* Haddock cleanup.+ # 0.1.2 * Added `IsEmbed` typeclass
src/Unbound/Generics/LocallyNameless.hs view
@@ -9,7 +9,7 @@ -- The purpose of @unbound-genrics@ is to simplify the construction of -- data structures with rich variable binding structure by providing -- generic implementations of alpha-equivalence ('aeq'), free variable--- permutation ('swaps'), local and glocal variable freshness+-- permutation ('swaps'), local and global variable freshness -- ('lfresh', 'fresh'), -- --
src/Unbound/Generics/LocallyNameless/Embed.hs view
@@ -34,12 +34,15 @@ newtype Embed t = Embed t deriving (Eq, Generic) class IsEmbed e where+ -- | The term type embedded in the embedding 'e' type Embedded e :: * -- | Insert or extract the embedded term. -- If you're not using the lens library, see 'Unbound.Generics.LocallyNameless.Operations.embed' -- and 'Unbound.Generics.LocallyNameless.Operations.unembed' -- otherwise 'embedded' is an isomorphism that you can use with lens.- -- @embedded :: Iso' (Embedded e) e@+ -- @+ -- embedded :: Iso' (Embedded e) e+ -- @ embedded :: (Profunctor p, Functor f) => p (Embedded e) (f (Embedded e)) -> p e (f e) instance IsEmbed (Embed t) where
src/Unbound/Generics/LocallyNameless/Operations.hs view
@@ -187,14 +187,13 @@ unrebind :: (Alpha p1, Alpha p2) => Rebind p1 p2 -> (p1, p2) unrebind (Rebnd p1 p2) = (p1, open (patternCtx initialCtx) p1 p2) --- | Embeds a term in an 'Embed', or an 'Embed' under some number of 'Shift's+-- | Embeds a term in an 'Embed', or an 'Embed' under some number of 'Unbound.Generics.LocallyNameless.Shift.Shift' constructors. embed :: IsEmbed e => Embedded e -> e-embed = view (from embedded)+embed e = view (from embedded) e -- | @'unembed' p@ extracts the term embedded in the pattern @p@.--- unembed :: Embed t -> t unembed :: IsEmbed e => e -> Embedded e-unembed = view embedded+unembed e = view embedded e -- | Constructor for recursive abstractions. trec :: Alpha p => p -> TRec p
src/Unbound/Generics/LocallyNameless/TH.hs view
@@ -18,14 +18,15 @@ import Unbound.Generics.LocallyNameless.Alpha (Alpha(..)) -- | Make a trivial @instance 'Alpha' T@ for a type @T@ that does not--- contains no bound nor free values of type @'Name' a@ or @'AnyName'@+-- contain any bound or free variable names -- (or any in general any values that are themselves non-trivial -- instances of 'Alpha'). Use this to write 'Alpha' instances for -- types that you don't want to traverse via their @GHC.Generics.Rep@ -- representation just to find out that there aren't any names. ----- @@@--- data T = T Int deriving (Eq, Ord, Show)+--+-- @+-- newtype T = T Int deriving (Eq, Ord, Show) -- $(makeClosedAlpha T) -- -- constructs -- -- instance Alpha T where@@ -41,7 +42,7 @@ -- -- swaps' _ _ = id -- -- freshen' _ i = return (i, mempty) -- -- lfreshen' _ i cont = cont i mempty--- @@@+-- @ -- makeClosedAlpha :: Name -> DecsQ makeClosedAlpha tyName = do
unbound-generics.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: unbound-generics-version: 0.1.2+version: 0.1.2.1 synopsis: Support for programming with names and binders using GHC Generics description: Specify the binding structure of your data type with an expressive set of type combinators, and unbound-generics