comonad 5.0.8 → 5.0.9
raw patch · 17 files changed
+33/−259 lines, 17 filesdep −semigroupsdep ~basedep ~containersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: semigroups
Dependency ranges changed: base, containers
API changes (from Hackage documentation)
- Control.Comonad: class Functor (f :: Type -> Type)
+ Control.Comonad: class () => Functor (f :: Type -> Type)
- Control.Comonad.Trans.Identity: newtype IdentityT (f :: k -> Type) (a :: k)
+ Control.Comonad.Trans.Identity: newtype () => IdentityT (f :: k -> Type) (a :: k)
Files
- CHANGELOG.markdown +7/−5
- comonad.cabal +14/−16
- src/Control/Comonad.hs +4/−47
- src/Control/Comonad/Env.hs +0/−5
- src/Control/Comonad/Env/Class.hs +0/−5
- src/Control/Comonad/Hoist/Class.hs +0/−5
- src/Control/Comonad/Identity.hs +0/−5
- src/Control/Comonad/Store.hs +0/−5
- src/Control/Comonad/Store/Class.hs +0/−8
- src/Control/Comonad/Traced.hs +0/−5
- src/Control/Comonad/Traced/Class.hs +0/−8
- src/Control/Comonad/Trans/Class.hs +0/−5
- src/Control/Comonad/Trans/Env.hs +4/−50
- src/Control/Comonad/Trans/Identity.hs +0/−5
- src/Control/Comonad/Trans/Store.hs +2/−36
- src/Control/Comonad/Trans/Traced.hs +2/−44
- src/Data/Functor/Composition.hs +0/−5
CHANGELOG.markdown view
@@ -1,10 +1,12 @@-5.0.8 [2020.12.30]+5.0.9 [2024.12.04] -------------------* Explicitly mark modules as Safe or Trustworthy.+* Drop support for pre-8.0 versions of GHC.++5.0.8 [2023.09.30]+-----------------+* Explicitly mark modules as Safe or Trustworthy * The build-type has been changed from `Custom` to `Simple`.- To achieve this, the `doctests` test suite has been removed in favor of using- [`cabal-docspec`](https://github.com/phadej/cabal-extras/tree/master/cabal-docspec)- to run the doctests.+ To achieve this, the `doctests` test suite has been removed in favor of using [`cabal-docspec`](https://github.com/phadej/cabal-extras/tree/master/cabal-docspec) to run the doctests. 5.0.7 [2020.12.15] ------------------
comonad.cabal view
@@ -1,6 +1,6 @@ name: comonad category: Control, Comonads-version: 5.0.8+version: 5.0.9 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -14,18 +14,19 @@ synopsis: Comonads description: Comonads. build-type: Simple-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+tested-with: GHC == 8.0.2 , GHC == 8.2.2 , GHC == 8.4.4 , GHC == 8.6.5- , GHC == 8.8.3- , GHC == 8.10.1+ , GHC == 8.8.4+ , GHC == 8.10.7+ , GHC == 9.0.2+ , GHC == 9.2.8+ , GHC == 9.4.8+ , GHC == 9.6.6+ , GHC == 9.8.4+ , GHC == 9.10.1+ , GHC == 9.12.1 extra-source-files: .gitignore .hlint.yaml@@ -76,16 +77,13 @@ ghc-options: -Wall build-depends:- base >= 4 && < 5,+ base >= 4.9 && < 5, tagged >= 0.8.6.1 && < 1,- transformers >= 0.3 && < 0.6,+ transformers >= 0.3 && < 0.7, transformers-compat >= 0.5 && < 1 - if !impl(ghc >= 8.0)- build-depends: semigroups >= 0.18.5 && < 1- if flag(containers)- build-depends: containers >= 0.3 && < 0.7+ build-depends: containers >= 0.3 && < 0.8 if flag(distributive) build-depends: distributive >= 0.5.2 && < 1
src/Control/Comonad.hs view
@@ -1,12 +1,8 @@ {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 707-{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving, Safe, DefaultSignatures #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy, DefaultSignatures #-}-#endif-#if __GLASGOW_HASKELL__ >= 706+{-# LANGUAGE DefaultSignatures #-}+{-# LANGUAGE Safe #-}+{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE PolyKinds #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad@@ -49,11 +45,6 @@ import Control.Arrow import Control.Category import Control.Monad (ap)-#if MIN_VERSION_base(4,7,0)--- Control.Monad.Instances is empty-#else-import Control.Monad.Instances-#endif import Control.Monad.Trans.Identity import Data.Functor.Identity import qualified Data.Functor.Sum as FSum@@ -62,7 +53,6 @@ import Data.Tagged import Prelude hiding (id, (.)) import Control.Monad.Fix-import Data.Typeable #ifdef MIN_VERSION_containers import Data.Tree@@ -146,9 +136,7 @@ extend :: (w a -> b) -> w a -> w b extend f = fmap f . duplicate -#if __GLASGOW_HASKELL__ >= 708 {-# MINIMAL extract, (duplicate | extend) #-}-#endif instance Comonad ((,)e) where@@ -177,14 +165,13 @@ extract = runIdentity {-# INLINE extract #-} -#if __GLASGOW_HASKELL__ >= 706 -- $ -- The variable `s` can have any kind. -- For example, here it has kind `Bool`: -- >>> :set -XDataKinds+-- >>> import Data.Tagged -- >>> extract (Tagged 42 :: Tagged 'True Integer) -- 42-#endif instance Comonad (Tagged s) where duplicate = Tagged {-# INLINE duplicate #-}@@ -255,10 +242,8 @@ class Comonad w => ComonadApply w where (<@>) :: w (a -> b) -> w a -> w b-#if __GLASGOW_HASKELL__ >= 702 default (<@>) :: Applicative w => w (a -> b) -> w a -> w b (<@>) = (<*>)-#endif (@>) :: w a -> w b -> w b a @> b = const id <$> a <@> b@@ -361,25 +346,7 @@ -- | The 'Cokleisli' 'Arrow's of a given 'Comonad' newtype Cokleisli w a b = Cokleisli { runCokleisli :: w a -> b }-#if __GLASGOW_HASKELL__ >= 707- deriving Typeable-#else-#ifdef __GLASGOW_HASKELL__-instance Typeable1 w => Typeable2 (Cokleisli w) where- typeOf2 twab = mkTyConApp cokleisliTyCon [typeOf1 (wa twab)]- where wa :: Cokleisli w a b -> w a- wa = undefined-#endif -cokleisliTyCon :: TyCon-#if MIN_VERSION_base(4,4,0)-cokleisliTyCon = mkTyCon3 "comonad" "Control.Comonad" "Cokleisli"-#else-cokleisliTyCon = mkTyCon "Control.Comonad.Cokleisli"-#endif-{-# NOINLINE cokleisliTyCon #-}-#endif- instance Comonad w => Category (Cokleisli w) where id = Cokleisli extract Cokleisli f . Cokleisli g = Cokleisli (f =<= g)@@ -411,13 +378,3 @@ instance Monad (Cokleisli w a) where return = pure Cokleisli k >>= f = Cokleisli $ \w -> runCokleisli (f (k w)) w--#if !(MIN_VERSION_base(4,7,0))--infixl 4 $>---- | Replace the contents of a functor uniformly with a constant value.-($>) :: Functor f => f a -> b -> f b-($>) = flip (<$)--#endif
src/Control/Comonad/Env.hs view
@@ -1,9 +1,4 @@-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Env
src/Control/Comonad/Env/Class.hs view
@@ -2,12 +2,7 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Env.Class
src/Control/Comonad/Hoist/Class.hs view
@@ -1,10 +1,5 @@ {-# LANGUAGE RankNTypes #-}-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Hoist.Class
src/Control/Comonad/Identity.hs view
@@ -1,9 +1,4 @@-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Identity
src/Control/Comonad/Store.hs view
@@ -1,9 +1,4 @@-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Store
src/Control/Comonad/Store/Class.hs view
@@ -1,13 +1,8 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Store.Class@@ -30,9 +25,6 @@ import qualified Control.Comonad.Trans.Store as Store import Control.Comonad.Trans.Traced import Control.Comonad.Trans.Identity-#if __GLASGOW_HASKELL__ < 710-import Data.Semigroup-#endif class Comonad w => ComonadStore s w | w -> s where pos :: w a -> s
src/Control/Comonad/Traced.hs view
@@ -1,9 +1,4 @@-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Traced
src/Control/Comonad/Traced/Class.hs view
@@ -1,13 +1,8 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Traced.Class@@ -29,9 +24,6 @@ import Control.Comonad.Trans.Store import qualified Control.Comonad.Trans.Traced as Traced import Control.Comonad.Trans.Identity-#if __GLASGOW_HASKELL__ < 710-import Data.Semigroup-#endif class Comonad w => ComonadTraced m w | w -> m where trace :: m -> w a -> a
src/Control/Comonad/Trans/Class.hs view
@@ -1,9 +1,4 @@-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Trans.Class
src/Control/Comonad/Trans/Env.hs view
@@ -1,13 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-}-#if __GLASGOW_HASKELL__ >= 707-{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable, Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif-#ifndef MIN_VERSION_base-#define MIN_VERSION_base(x,y,z) 1-#endif+{-# LANGUAGE Safe #-}+{-# LANGUAGE StandaloneDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Trans.Env@@ -62,59 +56,21 @@ , local ) where -#if !(MIN_VERSION_base(4,8,0))-import Control.Applicative-#endif import Control.Comonad import Control.Comonad.Hoist.Class import Control.Comonad.Trans.Class-#if __GLASGOW_HASKELL__ < 710-import Data.Foldable-import Data.Traversable-#endif+import Data.Data import Data.Functor.Identity #if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup #endif -#ifdef __GLASGOW_HASKELL__-#if __GLASGOW_HASKELL__ >= 707-#define Typeable1 Typeable-#endif-import Data.Data- -- $setup -- >>> import Control.Comonad -#if __GLASGOW_HASKELL__ >= 707-deriving instance Typeable EnvT-#else-instance (Typeable s, Typeable1 w) => Typeable1 (EnvT s w) where- typeOf1 dswa = mkTyConApp envTTyCon [typeOf (s dswa), typeOf1 (w dswa)]- where- s :: EnvT s w a -> s- s = undefined- w :: EnvT s w a -> w a- w = undefined--envTTyCon :: TyCon-#if __GLASGOW_HASKELL__ < 704-envTTyCon = mkTyCon "Control.Comonad.Trans.Env.EnvT"-#else-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- typeOf = typeOfDefault-#endif- instance ( Data e- , Typeable1 w, Data (w a)+ , Typeable w, Data (w a) , Data a ) => Data (EnvT e w a) where gfoldl f z (EnvT e wa) = z EnvT `f` e `f` wa@@ -132,8 +88,6 @@ envTDataType :: DataType envTDataType = mkDataType "Control.Comonad.Trans.Env.EnvT" [envTConstr] {-# NOINLINE envTDataType #-}--#endif type Env e = EnvT e Identity data EnvT e w a = EnvT e (w a)
src/Control/Comonad/Trans/Identity.hs view
@@ -1,9 +1,4 @@-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Trans.Identity
src/Control/Comonad/Trans/Store.hs view
@@ -1,9 +1,6 @@ {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 707-{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable, Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif+{-# LANGUAGE Safe #-}+{-# LANGUAGE StandaloneDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Trans.Store@@ -75,9 +72,6 @@ , experiment ) where -#if __GLASGOW_HASKELL__ < 710-import Control.Applicative-#endif import Control.Comonad import Control.Comonad.Hoist.Class import Control.Comonad.Trans.Class@@ -86,37 +80,9 @@ import Data.Semigroup #endif -#ifdef __GLASGOW_HASKELL__-import Data.Typeable- -- $setup -- >>> import Control.Comonad -- >>> import Data.Tuple (swap)--#if __GLASGOW_HASKELL__ >= 707-deriving instance Typeable StoreT-#else-instance (Typeable s, Typeable1 w) => Typeable1 (StoreT s w) where- typeOf1 dswa = mkTyConApp storeTTyCon [typeOf (s dswa), typeOf1 (w dswa)]- where- s :: StoreT s w a -> s- s = undefined- w :: StoreT s w a -> w a- w = undefined--instance (Typeable s, Typeable1 w, Typeable a) => Typeable (StoreT s w a) where- typeOf = typeOfDefault--storeTTyCon :: TyCon-#if __GLASGOW_HASKELL__ < 704-storeTTyCon = mkTyCon "Control.Comonad.Trans.Store.StoreT"-#else-storeTTyCon = mkTyCon3 "comonad-transformers" "Control.Comonad.Trans.Store" "StoreT"-#endif-{-# NOINLINE storeTTyCon #-}-#endif--#endif type Store s = StoreT s Identity
src/Control/Comonad/Trans/Traced.hs view
@@ -1,9 +1,6 @@ {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 707-{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable, Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif+{-# LANGUAGE Safe #-}+{-# LANGUAGE StandaloneDeriving #-} #ifdef MIN_VERSION_indexed_traversable {-# LANGUAGE MultiParamTypeClasses, UndecidableInstances #-} #endif@@ -39,14 +36,6 @@ , censor ) where -#if __GLASGOW_HASKELL__ < 710-import Control.Applicative-#endif--#if __GLASGOW_HASKELL__ < 707-import Control.Monad.Instances ()-#endif- import Control.Monad (ap) import Control.Comonad import Control.Comonad.Hoist.Class@@ -62,13 +51,7 @@ import Data.Functor.Identity -#if __GLASGOW_HASKELL__ < 710-import Data.Semigroup-#endif -import Data.Typeable-- type Traced m = TracedT m Identity traced :: (m -> a) -> Traced m a@@ -121,28 +104,3 @@ censor :: Functor w => (m -> m) -> TracedT m w a -> TracedT m w a censor g = TracedT . fmap (. g) . runTracedT--#ifdef __GLASGOW_HASKELL__--#if __GLASGOW_HASKELL__ >= 707-deriving instance Typeable TracedT-#else-instance (Typeable s, Typeable1 w) => Typeable1 (TracedT s w) where- typeOf1 dswa = mkTyConApp tracedTTyCon [typeOf (s dswa), typeOf1 (w dswa)]- where- s :: TracedT s w a -> s- s = undefined- w :: TracedT s w a -> w a- w = undefined--tracedTTyCon :: TyCon-#if __GLASGOW_HASKELL__ < 704-tracedTTyCon = mkTyCon "Control.Comonad.Trans.Traced.TracedT"-#else-tracedTTyCon = mkTyCon3 "comonad-transformers" "Control.Comonad.Trans.Traced" "TracedT"-#endif-{-# NOINLINE tracedTTyCon #-}--#endif--#endif
src/Data/Functor/Composition.hs view
@@ -1,9 +1,4 @@-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif module Data.Functor.Composition ( Composition(..) ) where