packages feed

bound 1.0 → 1.0.1

raw patch · 4 files changed

+16/−4 lines, 4 files

Files

CHANGELOG.markdown view
@@ -1,3 +1,8 @@+1.0.1+-----+* Added a monomorphic `hoistScope` for `Bound.Scope.Simple`++ 1.0 --- * Added instances for `Bound` for all of the `mtl` monads.
bound.cabal view
@@ -1,6 +1,6 @@ name:          bound category:      Language, Compilers/Interpreters-version:       1.0+version:       1.0.1 license:       BSD3 cabal-version: >= 1.9.2 license-file:  LICENSE
src/Bound/Class.hs view
@@ -39,13 +39,15 @@ -- -- This means they should satisfy the following laws: ----- > m >>>= return ≡ m--- > m >>>= (λ x → k x >>= h) ≡ (m >>>= k) >>>= h+-- @+-- m '>>>=' 'return' ≡ m+-- m '>>>=' (λ x → k x '>>=' h) ≡ (m '>>>=' k) '>>>=' h+-- @ -- -- This guarantees that a typical Monad instance for an expression type -- where Bound instances appear will satisfy the Monad laws (see doc/BoundLaws.hs). ----- If instances of Bound are monad transformers, then @m '>>>=' f ≡ m '>>=' 'lift' '.' f@+-- If instances of 'Bound' are monad transformers, then @m '>>>=' f ≡ m '>>=' 'lift' '.' f@ -- implies the above laws, and is in fact the default definition. -- -- This is useful for types like expression lists, case alternatives,
src/Bound/Scope/Simple.hs view
@@ -56,6 +56,7 @@   , mapMScope   , serializeScope   , deserializeScope+  , hoistScope   ) where  import Bound.Class@@ -231,6 +232,10 @@ instantiate1 :: Monad f => f a -> Scope n f a -> f a instantiate1 e = instantiate (const e) {-# INLINE instantiate1 #-}++hoistScope :: Monad f => (f (Var b a) -> g (Var b a)) -> Scope b f a -> Scope b g a+hoistScope f = Scope . f . unscope+{-# INLINE hoistScope #-}  ------------------------------------------------------------------------------- -- Compatibility with Bound.Scope