comonad 5.0.3 → 5.0.4
raw patch · 4 files changed
+62/−38 lines, 4 filesdep ~containersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: containers
API changes (from Hackage documentation)
- Control.Comonad: instance Control.Comonad.Comonad (Data.Tagged.Tagged s)
- Control.Comonad: instance Control.Comonad.Comonad Data.List.NonEmpty.NonEmpty
- Control.Comonad: instance Control.Comonad.ComonadApply Data.List.NonEmpty.NonEmpty
- Control.Comonad: instance Data.Semigroup.Semigroup m => Control.Comonad.ComonadApply ((,) m)
- Control.Comonad: instance GHC.Base.Applicative (Control.Comonad.Cokleisli w a)
- Control.Comonad: instance GHC.Base.Functor (Control.Comonad.Cokleisli w a)
- Control.Comonad: instance GHC.Base.Monad (Control.Comonad.Cokleisli w a)
- Control.Comonad.Trans.Env: instance (Data.Semigroup.Semigroup e, Control.Comonad.ComonadApply w) => Control.Comonad.ComonadApply (Control.Comonad.Trans.Env.EnvT e w)
- Control.Comonad.Trans.Identity: newtype IdentityT k (f :: k -> *) (a :: k) :: forall k. () => (k -> *) -> k -> *
- Control.Comonad.Trans.Store: instance (Control.Comonad.ComonadApply w, Data.Semigroup.Semigroup s) => Control.Comonad.ComonadApply (Control.Comonad.Trans.Store.StoreT s w)
+ Control.Comonad: instance Control.Comonad.Comonad GHC.Base.NonEmpty
+ Control.Comonad: instance Control.Comonad.ComonadApply GHC.Base.NonEmpty
+ Control.Comonad: instance GHC.Base.Semigroup m => Control.Comonad.ComonadApply ((,) m)
+ Control.Comonad: instance forall k (s :: k). Control.Comonad.Comonad (Data.Tagged.Tagged s)
+ Control.Comonad: instance forall k (w :: k -> *) (a :: k). GHC.Base.Applicative (Control.Comonad.Cokleisli w a)
+ Control.Comonad: instance forall k (w :: k -> *) (a :: k). GHC.Base.Functor (Control.Comonad.Cokleisli w a)
+ Control.Comonad: instance forall k (w :: k -> *) (a :: k). GHC.Base.Monad (Control.Comonad.Cokleisli w a)
+ Control.Comonad.Trans.Env: instance (GHC.Base.Semigroup e, Control.Comonad.ComonadApply w) => Control.Comonad.ComonadApply (Control.Comonad.Trans.Env.EnvT e w)
+ Control.Comonad.Trans.Identity: newtype IdentityT (f :: k -> *) (a :: k) :: forall k. () => k -> * -> k -> *
+ Control.Comonad.Trans.Store: instance (Control.Comonad.ComonadApply w, GHC.Base.Semigroup s) => Control.Comonad.ComonadApply (Control.Comonad.Trans.Store.StoreT s w)
- Control.Comonad: (<$>) :: Functor f => (a -> b) -> f a -> f b
+ Control.Comonad: (<$>) :: Functor f => a -> b -> f a -> f b
- Control.Comonad: Cokleisli :: (w a -> b) -> Cokleisli w a b
+ Control.Comonad: Cokleisli :: w a -> b -> Cokleisli w a b
- Control.Comonad: fmap :: Functor f => (a -> b) -> f a -> f b
+ Control.Comonad: fmap :: Functor f => a -> b -> f a -> f b
- Control.Comonad.Trans.Identity: IdentityT :: f a -> IdentityT k
+ Control.Comonad.Trans.Identity: IdentityT :: f a -> IdentityT
- Control.Comonad.Trans.Identity: [runIdentityT] :: IdentityT k -> f a
+ Control.Comonad.Trans.Identity: [runIdentityT] :: IdentityT -> f a
Files
- .travis.yml +41/−34
- CHANGELOG.markdown +6/−0
- comonad.cabal +4/−4
- src/Control/Comonad.hs +11/−0
.travis.yml view
@@ -1,6 +1,6 @@ # This Travis job script has been generated by a script via #-# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--irc-channel=irc.freenode.org#haskell-lens' '--no-no-tests-no-bench' '--no-installed' 'cabal.project'+# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--ghc-head' '--irc-channel=irc.freenode.org#haskell-lens' '--no-no-tests-no-bench' '--no-unconstrained' 'cabal.project' # # For more information, see https://github.com/hvr/multi-ghc-travis #@@ -36,42 +36,45 @@ matrix: include:- - compiler: "ghc-7.0.4"+ - compiler: "ghc-8.6.1"+ env: GHCHEAD=true+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.1], sources: [hvr-ghc]}}+ - compiler: "ghc-8.4.3" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.0.4], sources: [hvr-ghc]}}- - compiler: "ghc-7.2.2"+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}}+ - compiler: "ghc-8.2.2" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.2.2], sources: [hvr-ghc]}}- - compiler: "ghc-7.4.2"+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2], sources: [hvr-ghc]}}+ - compiler: "ghc-8.0.2" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.4.2], sources: [hvr-ghc]}}- - compiler: "ghc-7.6.3"+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2], sources: [hvr-ghc]}}+ - compiler: "ghc-7.10.3" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.6.3], sources: [hvr-ghc]}}+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3], sources: [hvr-ghc]}} - compiler: "ghc-7.8.4" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.8.4], sources: [hvr-ghc]}}- - compiler: "ghc-7.10.3"+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.4], sources: [hvr-ghc]}}+ - compiler: "ghc-7.6.3"+ env: HADDOCK=false # Work around https://github.com/haskell/haddock/issues/242+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.3], sources: [hvr-ghc]}}+ - compiler: "ghc-7.4.2" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.10.3], sources: [hvr-ghc]}}- - compiler: "ghc-8.0.2"+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.4.2], sources: [hvr-ghc]}}+ - compiler: "ghc-7.2.2" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-8.0.2], sources: [hvr-ghc]}}- - compiler: "ghc-8.2.2"+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.2.2], sources: [hvr-ghc]}}+ - compiler: "ghc-7.0.4" # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}- - compiler: "ghc-8.4.1"- env: GHCHEAD=true- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.0.4], sources: [hvr-ghc]}} - compiler: "ghc-head" env: GHCHEAD=true addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}} allow_failures:+ - compiler: "ghc-head" - compiler: "ghc-7.0.4" - compiler: "ghc-7.2.2"- - compiler: "ghc-8.4.1"- - compiler: "ghc-head"+ - compiler: "ghc-8.6.1" before_install: - HC=${CC}@@ -88,13 +91,9 @@ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" - BENCH=${BENCH---enable-benchmarks} - TEST=${TEST---enable-tests}- - | # Work around https://github.com/haskell/haddock/issues/242- if [ "${HC}" != "ghc-7.6.3" ]; then- HADDOCK=${HADDOCK-true}- else- HADDOCK=${HADDOCK-false}- fi- - INSTALLED=${INSTALLED-true}+ - HADDOCK=${HADDOCK-true}+ - UNCONSTRAINED=${UNCONSTRAINED-true}+ - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false} - GHCHEAD=${GHCHEAD-false} - travis_retry cabal update -v - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"@@ -102,7 +101,8 @@ # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage - | if $GHCHEAD; then- sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config+ sed -i 's/-- allow-newer: .*/allow-newer: *:base/' ${HOME}/.cabal/config+ for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" ${HOME}/.cabal/config; done echo 'repository head.hackage' >> ${HOME}/.cabal/config echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config@@ -112,11 +112,16 @@ echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config echo ' key-threshold: 3' >> ${HOME}/.cabal.config + grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'+ cabal new-update head.hackage -v fi - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' - "printf 'packages: \".\" \"./examples\"\\n' > cabal.project"- - cat cabal.project+ - touch cabal.project.local+ - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"+ - cat cabal.project || true+ - cat cabal.project.local || true - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi@@ -125,7 +130,7 @@ fi - rm -f cabal.project.freeze - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all- - rm -rf "."/.ghc.environment.* "./examples"/.ghc.environment.* "."/dist "./examples"/dist+ - rm -rf .ghc.environment.* "."/dist "./examples"/dist - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) # Here starts the actual work to be performed for the package under test;@@ -138,8 +143,10 @@ - cd ${DISTDIR} || false - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; - "printf 'packages: comonad-*/*.cabal comonad-examples-*/*.cabal\\n' > cabal.project"- - cat cabal.project-+ - touch cabal.project.local+ - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"+ - cat cabal.project || true+ - cat cabal.project.local || true # build & run tests, build benchmarks - cabal new-build -w ${HC} ${TEST} ${BENCH} all@@ -153,5 +160,5 @@ - rm -rf ./dist-newstyle - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi -# REGENDATA ["-o",".travis.yml","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-installed","cabal.project"]+# REGENDATA ["-o",".travis.yml","--ghc-head","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-unconstrained","cabal.project"] # EOF
CHANGELOG.markdown view
@@ -1,3 +1,9 @@+5.0.4 [2018.07.01]+------------------+* Add `Comonad` instances for `Tagged s` with `s` of any kind. Before the+ change, `s` had to be of kind `*`.+* Allow `containers-0.6`.+ 5.0.3 [2018.02.06] ------------------ * Don't enable `Safe` on GHC 7.2.
comonad.cabal view
@@ -1,6 +1,6 @@ name: comonad category: Control, Comonads-version: 5.0.3+version: 5.0.4 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -14,7 +14,7 @@ synopsis: Comonads description: Comonads. build-type: Custom-tested-with: GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1+tested-with: GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1 extra-source-files: .ghci .gitignore@@ -86,7 +86,7 @@ transformers-compat >= 0.3 && < 1 if flag(containers)- build-depends: containers >= 0.3 && < 0.6+ build-depends: containers >= 0.3 && < 0.7 if flag(contravariant) build-depends: contravariant >= 0.2.0.1 && < 2@@ -132,4 +132,4 @@ build-depends: base, comonad,- doctest >= 0.11.1 && < 0.14+ doctest >= 0.11.1 && < 0.17
src/Control/Comonad.hs view
@@ -4,6 +4,9 @@ #elif __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy, DefaultSignatures #-} #endif+#if __GLASGOW_HASKELL__ >= 706+{-# LANGUAGE PolyKinds #-}+#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad@@ -176,6 +179,14 @@ extract = runIdentity {-# INLINE extract #-} +#if __GLASGOW_HASKELL__ >= 706+-- $+-- The variable `s` can have any kind.+-- For example, here it has kind `Bool`:+-- >>> :set -XDataKinds+-- >>> extract (Tagged 42 :: Tagged 'True Integer)+-- 42+#endif instance Comonad (Tagged s) where duplicate = Tagged {-# INLINE duplicate #-}