packages feed

comonad-extras 2.0.3 → 2.1

raw patch · 2 files changed

+26/−22 lines, 2 filesdep ~arraydep ~comonaddep ~comonad-transformersPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: array, comonad, comonad-transformers, comonads-fd, semigroupoids, transformers

API changes (from Hackage documentation)

Files

Control/Comonad/Store/Pointer.hs view
@@ -9,14 +9,14 @@ -- Stability   :  provisional -- Portability :  portable ----- The array-backed store (state-in-context/costate) comonad transformer is +-- The array-backed store (state-in-context/costate) comonad transformer is -- subject to the laws:--- +-- -- > x = seek (pos x) x -- > y = pos (seek y x) -- > seek y x = seek y (seek z x) ----- Thanks go to Russell O'Connor and Daniel Peebles for their help +-- Thanks go to Russell O'Connor and Daniel Peebles for their help -- formulating and proving the laws for this comonad transformer. -- -- This basic version of this transformer first appeared on Dan Piponi's blog@@ -28,12 +28,12 @@ -- NB: attempting to seek or peek out of bounds will yield an error. ---------------------------------------------------------------------------- module Control.Comonad.Store.Pointer-  ( +  (   -- * The Pointer comonad     Pointer, pointer, runPointer   -- * The Pointer comonad transformer   , PointerT(..), runPointerT-  , pointerBounds +  , pointerBounds   , module Control.Comonad.Store.Class   ) where @@ -41,9 +41,9 @@ import Control.Comonad import Control.Comonad.Hoist.Class import Control.Comonad.Trans.Class-import Control.Comonad.Store.Class -import Control.Comonad.Traced.Class -import Control.Comonad.Env.Class +import Control.Comonad.Store.Class+import Control.Comonad.Traced.Class+import Control.Comonad.Env.Class import Data.Functor.Identity import Data.Array @@ -61,13 +61,17 @@   typeOf = typeOfDefault  storeTTyCon :: TyCon+#if __GLASGOW_HASKELL__ < 704 storeTTyCon = mkTyCon "Control.Comonad.Trans.Store.Pointer.PointerT"+#else+storeTTyCon = mkTyCon3 "comonad-extras" "Control.Comonad.Trans.Store.Pointer" "PointerT"+#endif {-# NOINLINE storeTTyCon #-} #endif  type Pointer i = PointerT i Identity -pointer :: Array i a -> i -> Pointer i a +pointer :: Array i a -> i -> Pointer i a pointer f i = PointerT (Identity f) i  runPointer :: Pointer i a -> (Array i a, i)@@ -83,11 +87,11 @@  instance (Comonad w, Ix i) => Extend (PointerT i w) where   duplicate (PointerT g i) = PointerT (extend p g) i where-    p wa = listArray b $ PointerT wa <$> range b where -      b = bounds (extract wa) +    p wa = listArray b $ PointerT wa <$> range b where+      b = bounds (extract wa)  instance (Comonad w, Ix i) => Comonad (PointerT i w) where-  extract (PointerT g i) = extract g ! i +  extract (PointerT g i) = extract g ! i  instance Ix i => ComonadTrans (PointerT i) where   lower (PointerT g i) = fmap (! i) g@@ -99,7 +103,7 @@   pos (PointerT _ i) = i   seek i ~(PointerT g _) = PointerT g i   seeks f ~(PointerT g i) = PointerT g (f i)-  peek i (PointerT g _) = extract g ! i +  peek i (PointerT g _) = extract g ! i   peeks f ~(PointerT g i) = extract g ! f i  -- | Extract the bounds of the currently focused array
comonad-extras.cabal view
@@ -1,6 +1,6 @@ name:          comonad-extras category:      Control, Comonads-version:       2.0.3+version:       2.1 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -32,16 +32,16 @@     Rank2Types     MultiParamTypeClasses -  build-depends: -    array                >= 0.3.0.2 && < 0.5,+  build-depends:+    array                >= 0.3     && < 0.5,     base                 >= 4       && < 5,     containers           >= 0.4     && < 0.5,-    comonad              >= 1.1.1.1 && < 1.2,-    comonad-transformers >= 2.0.3   && < 2.1,-    comonads-fd          >= 2.0.2.1 && < 2.1,+    comonad              >= 1.1.1.3 && < 1.2,+    comonad-transformers >= 2.1     && < 2.2,+    comonads-fd          >= 2.1     && < 2.2,     distributive         >= 0.2     && < 0.3,-    semigroupoids        >= 1.2.6.1 && < 1.3,-    transformers         >= 0.2.0   && < 0.3+    semigroupoids        >= 1.3     && < 1.4,+    transformers         >= 0.3     && < 0.4    if flag(DeriveDataTypeable)     extensions: DeriveDataTypeable@@ -51,4 +51,4 @@     Control.Comonad.Store.Zipper     Control.Comonad.Store.Pointer -  ghc-options:      -Wall +  ghc-options:      -Wall