summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwardKmett <>2014-06-03 17:58:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-06-03 17:58:00 (GMT)
commitb5ee29e2adf07396a704adde904fc3ce21f89600 (patch)
tree8db156cad8f3fbd0eae04b0fa4105532c30f8777
parent2e19a8184a895519b8dc08a1aa9c79dcddae64e2 (diff)
version 1.0.31.0.3
-rw-r--r--.travis.yml8
-rw-r--r--CHANGELOG.markdown6
-rw-r--r--bound.cabal5
-rw-r--r--src/Bound/Scope.hs7
4 files changed, 19 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
index 0c0b082..b1becb5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,11 +8,15 @@ before_install:
- 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:
diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
index 35ba5bb..da29719 100644
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,13 +1,15 @@
+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
---
* Added instances for `Bound` for all of the `mtl` monads.
diff --git a/bound.cabal b/bound.cabal
index 48b0664..3e89220 100644
--- a/bound.cabal
+++ b/bound.cabal
@@ -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 @@ library
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
diff --git a/src/Bound/Scope.hs b/src/Bound/Scope.hs
index 7216a58..870ade8 100644
--- a/src/Bound/Scope.hs
+++ b/src/Bound/Scope.hs
@@ -61,6 +61,7 @@ module Bound.Scope
, deserializeScope
, hoistScope
, bitraverseScope
+ , bitransverseScope
, transverseScope
, instantiateVars
) where
@@ -399,7 +400,7 @@ deserializeScope gb gv = liftM Scope $ deserializeWith (deserializeWith2 gb $ de
-- | 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'.
@@ -408,6 +409,10 @@ transverseScope :: (Applicative f, Monad f, Traversable g)
-> 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
instantiateVars as = instantiate (vs !!) where