bound 1.0.2 → 1.0.3
raw patch · 4 files changed
+19/−7 lines, 4 files
Files
- .travis.yml +6/−2
- CHANGELOG.markdown +4/−2
- bound.cabal +3/−2
- src/Bound/Scope.hs +6/−1
.travis.yml view
@@ -8,11 +8,15 @@ - travis/cabal-apt-install $mode install:+ - cabal install packunused packdeps - cabal configure $mode- - cabal build+ - cabal build --ghc-options=-ddump-minimal-imports script:- - $script && hlint src --cpp-define HLINT+ - $script+ - packdeps bound.cabal+ - packunused+ - hlint src --cpp-define HLINT notifications: irc:
CHANGELOG.markdown view
@@ -1,12 +1,14 @@+1.0.3+-----+* Added `bitransverseScope`.+ 1.0.2 ----- * Removed unneccesary constraint on `hoistScope`. - 1.0.1 ----- * Added a monomorphic `hoistScope` for `Bound.Scope.Simple`- 1.0 ---
bound.cabal view
@@ -1,6 +1,6 @@ name: bound category: Language, Compilers/Interpreters-version: 1.0.2+version: 1.0.3 license: BSD3 cabal-version: >= 1.9.2 license-file: LICENSE@@ -78,7 +78,8 @@ transformers >= 0.2 && < 0.4 ghc-options: -Wall -O2 -fspec-constr -fdicts-cheap -funbox-strict-fields- if impl(ghc>=7.4)++ if impl(ghc >=7.4 && < 7.6) build-depends: ghc-prim test-suite Simple
src/Bound/Scope.hs view
@@ -61,6 +61,7 @@ , deserializeScope , hoistScope , bitraverseScope+ , bitransverseScope , transverseScope , instantiateVars ) where@@ -399,7 +400,7 @@ -- | This allows you to 'bitraverse' a 'Scope'. bitraverseScope :: (Bitraversable t, Applicative f) => (k -> f k') -> (a -> f a') -> Scope b (t k) a -> f (Scope b (t k') a')-bitraverseScope f g = fmap Scope . bitraverse f (traverse (bitraverse f g)) . unscope+bitraverseScope f = bitransverseScope (bitraverse f) {-# INLINE bitraverseScope #-} -- | This is a higher-order analogue of 'traverse'.@@ -407,6 +408,10 @@ => (forall r. g r -> f (h r)) -> Scope b g a -> f (Scope b h a) transverseScope tau (Scope e) = Scope <$> (tau =<< traverse (traverse tau) e)++bitransverseScope :: Applicative f => (forall a a'. (a -> f a') -> t a -> f (u a')) -> (a -> f a') -> Scope b t a -> f (Scope b u a')+bitransverseScope tau f = fmap Scope . tau (_F (tau f)) . unscope+{-# INLINE bitransverseScope #-} -- | instantiate bound variables using a list of new variables instantiateVars :: Monad t => [a] -> Scope Int t a -> t a