packages feed

unbound-generics 0.0.2.1 → 0.0.3

raw patch · 4 files changed

+33/−2 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Unbound.Generics.LocallyNameless.Name: instance Typeable Name
+ Unbound.Generics.LocallyNameless.Alpha: gaeq :: GAlpha f => AlphaCtx -> f a -> f a -> Bool
+ Unbound.Generics.LocallyNameless.Alpha: gclose :: (GAlpha f, Alpha b) => AlphaCtx -> b -> f a -> f a
+ Unbound.Generics.LocallyNameless.Alpha: gfreshen :: (GAlpha f, Fresh m) => AlphaCtx -> f a -> m (f a, Perm AnyName)
+ Unbound.Generics.LocallyNameless.Alpha: gfvAny :: (GAlpha f, Contravariant g, Applicative g) => AlphaCtx -> (AnyName -> g AnyName) -> f a -> g (f a)
+ Unbound.Generics.LocallyNameless.Alpha: gisPat :: GAlpha f => f a -> DisjointSet AnyName
+ Unbound.Generics.LocallyNameless.Alpha: gisTerm :: GAlpha f => f a -> Bool
+ Unbound.Generics.LocallyNameless.Alpha: glfreshen :: (GAlpha f, LFresh m) => AlphaCtx -> f a -> (f a -> Perm AnyName -> m b) -> m b
+ Unbound.Generics.LocallyNameless.Alpha: gnamePatFind :: GAlpha f => f a -> NamePatFind
+ Unbound.Generics.LocallyNameless.Alpha: gnthPatFind :: GAlpha f => f a -> NthPatFind
+ Unbound.Generics.LocallyNameless.Alpha: gopen :: (GAlpha f, Alpha b) => AlphaCtx -> b -> f a -> f a
+ Unbound.Generics.LocallyNameless.Alpha: gswaps :: GAlpha f => AlphaCtx -> Perm AnyName -> f a -> f a
+ Unbound.Generics.LocallyNameless.Name: instance Typeable1 Name
+ Unbound.Generics.LocallyNameless.Name: name2Integer :: Name a -> Integer

Files

Changelog.md view
@@ -1,3 +1,16 @@+# 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)
src/Unbound/Generics/LocallyNameless/Alpha.hs view
@@ -27,6 +27,18 @@   , termCtx   , isTermCtx   , incrLevelCtx+  -- * Internal+  , gaeq+  , gfvAny+  , gclose+  , gopen+  , gisPat+  , gisTerm+  , gnthPatFind+  , gnamePatFind+  , gswaps+  , gfreshen+  , glfreshen   ) where  import Control.Applicative (Applicative(..), (<$>))
src/Unbound/Generics/LocallyNameless/Name.hs view
@@ -22,6 +22,7 @@        , makeName          -- * Name inspection        , name2String+       , name2Integer          -- * Heterogeneous names        , AnyName(..)        ) where@@ -65,10 +66,15 @@ makeName :: String -> Integer -> Name a makeName = Fn +-- | Get the integer part of a 'Name'.+name2Integer :: Name a -> Integer+name2Integer (Fn _ i) = i+name2Integer (Bn _ _) = error "Internal Error: cannot call name2Integer for bound names"+ -- | Get the string part of a 'Name'. name2String :: Name a -> String name2String (Fn s _) = s-name2String (Bn _ _)   = error "Internal Error: cannot call name2Integer for bound names"+name2String (Bn _ _) = error "Internal Error: cannot call name2String for bound names"  instance Show (Name a) where   show (Fn "" n) = "_" ++ (show n)
unbound-generics.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                unbound-generics-version:             0.0.2.1+version:             0.0.3 synopsis:            Reimplementation of Unbound using GHC Generics description:         Specify the binding structure of your data type with an                      expressive set of type combinators, and unbound-generics