comonad 4.0 → 4.0.1
raw patch · 6 files changed
+40/−16 lines, 6 filesdep ~doctest
Dependency ranges changed: doctest
Files
- CHANGELOG.markdown +4/−0
- HLint.hs +4/−0
- comonad.cabal +3/−2
- src/Control/Comonad/Trans/Env.hs +2/−1
- src/Control/Comonad/Trans/Store.hs +25/−13
- src/Control/Comonad/Trans/Traced.hs +2/−0
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+4.0.1+-----+* Fixes to avoid warnings on GHC 7.8.1+ 4.0 --- * Merged the contents of `comonad-transformers` and `comonads-fd` into this package.
+ HLint.hs view
@@ -0,0 +1,4 @@+import "hint" HLint.HLint++ignore "Eta reduce"+ignore "Use import/export shortcut"
comonad.cabal view
@@ -1,6 +1,6 @@ name: comonad category: Control, Comonads-version: 4.0+version: 4.0.1 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -23,6 +23,7 @@ README.markdown CHANGELOG.markdown examples/History.hs+ HLint.hs -- You can disable the doctests test suite with -f-test-doctests flag test-doctests@@ -88,7 +89,7 @@ build-depends: base, directory >= 1.0,- doctest >= 0.9.1,+ doctest >= 0.9.10, filepath if impl(ghc<7.6.1)
src/Control/Comonad/Trans/Env.hs view
@@ -84,7 +84,6 @@ s = undefined w :: EnvT s w a -> w a w = undefined-#endif envTTyCon :: TyCon #if __GLASGOW_HASKELL__ < 704@@ -93,6 +92,8 @@ envTTyCon = mkTyCon3 "comonad-transformers" "Control.Comonad.Trans.Env" "EnvT" #endif {-# NOINLINE envTTyCon #-}++#endif #if __GLASGOW_HASKELL__ < 707 instance (Typeable s, Typeable1 w, Typeable a) => Typeable (EnvT s w a) where
src/Control/Comonad/Trans/Store.hs view
@@ -24,24 +24,33 @@ -- -- @stored value = (1, 5)@, @accessor = fst@, @resulting focus = 1@: ----- > storeTuple :: Store (Int, Int) Int--- > storeTuple = store fst (1, 5)+-- >>> :{+-- let+-- storeTuple :: Store (Int, Int) Int+-- storeTuple = store fst (1, 5)+-- :} -- -- Add something to the focus: ----- > addToFocus :: Int -> Store (Int, Int) Int -> Int--- > addToFocus x wa = x + extract wa--- >--- > added3 :: Store (Int, Int) Int--- > added3 = extend (addToFocus 3) storeTuple+-- >>> :{+-- let+-- addToFocus :: Int -> Store (Int, Int) Int -> Int+-- addToFocus x wa = x + extract wa+-- :} --+-- >>> :{+-- let+-- added3 :: Store (Int, Int) Int+-- added3 = extend (addToFocus 3) storeTuple+-- :}+-- -- The focus of added3 is now @1 + 3 = 4@. However, this action changed only -- the accessor function and therefore the focus but not the stored value: ----- > pos added3--- (1, 5)+-- >>> pos added3+-- (1,5) ----- > extract added3+-- >>> extract added3 -- 4 -- -- The strict store (state-in-context/costate) comonad transformer is subject@@ -77,6 +86,9 @@ #ifdef __GLASGOW_HASKELL__ import Data.Typeable +-- $setup+-- >>> import Data.Tuple (swap)+ #if __GLASGOW_HASKELL__ >= 707 deriving instance Typeable StoreT #else@@ -147,8 +159,8 @@ -- | Set the stored value ----- > pos . seek (3,7) $ store fst (1,5)--- > (3,7)+-- >>> pos . seek (3,7) $ store fst (1,5)+-- (3,7) -- -- Seek satisfies the law --@@ -158,7 +170,7 @@ -- | Modify the stored value ----- > pos . seeks swap $ store fst (1,5)+-- >>> pos . seeks swap $ store fst (1,5) -- (5,1) -- -- Seeks satisfies the law
src/Control/Comonad/Trans/Traced.hs view
@@ -38,7 +38,9 @@ ) where import Control.Applicative+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 707 import Control.Monad.Instances ()+#endif import Control.Monad (ap) import Control.Comonad import Control.Comonad.Hoist.Class