natural-transformation 0.4 → 0.4.1
raw patch · 6 files changed
+30/−27 lines, 6 filesdep −semigroupsdep ~basedep ~containersdep ~natural-transformation
Dependencies removed: semigroups
Dependency ranges changed: base, containers, natural-transformation, quickcheck-instances, tasty-quickcheck
Files
- CHANGELOG.md +3/−0
- README.md +3/−3
- natural-transformation.cabal +19/−11
- src/Control/Natural.hs +2/−6
- src/Control/Natural/RULES.hs +1/−1
- tests/Properties.hs +2/−6
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 0.4.1 [2024.10.27]+* Drop support for pre-8.0 versions of GHC.+ # 0.4 * Rename `Nat` constructor to `NT` * Rename `run` to `unwrapNT`
README.md view
@@ -1,5 +1,5 @@-# natural-transformation [](http://hackage.haskell.org/package/natural-transformation) [](https://travis-ci.org/ku-fpg/natural-transformation)+# natural-transformation [](http://hackage.haskell.org/package/natural-transformation) [](https://github.com/ku-fpg/natural-transformation/actions?query=workflow%3AHaskell-CI) -A natural transformation transforms a container `f a` into another container `g a`. -Natural transformations act as functor morphisms in category theory. +A natural transformation transforms a container `f a` into another container `g a`.+Natural transformations act as functor morphisms in category theory. Technically, `f` and `g` should be functors, but we allow any correctly-shaped structure.
natural-transformation.cabal view
@@ -1,5 +1,5 @@ name: natural-transformation-version: 0.4+version: 0.4.1 synopsis: A natural transformation package. description: A natural transformation transforms a container @f a@ into another container @g a@. Natural transformations act as functor morphisms@@ -18,7 +18,18 @@ category: Control build-type: Simple extra-source-files: CHANGELOG.md, README.md-tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1+tested-with: GHC == 8.0.2+ , GHC == 8.2.2+ , GHC == 8.4.4+ , GHC == 8.6.5+ , 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.2+ , GHC == 9.10.1 cabal-version: >= 1.10 source-repository head@@ -30,10 +41,7 @@ Control.Natural.RULES Control.Object - build-depends: base >= 4.7 && < 5- if !impl(ghc >= 8.0)- build-depends: semigroups >= 0.16 && < 0.19-+ build-depends: base >= 4.9 && < 5 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall@@ -41,12 +49,12 @@ test-suite natural-transformation-properties type: exitcode-stdio-1.0 main-is: Properties.hs- build-depends: base >= 4.7 && < 5- , containers >= 0.1 && < 0.6- , natural-transformation == 0.4+ build-depends: base >= 4.9 && < 5+ , containers >= 0.1 && < 0.8+ , natural-transformation , quickcheck-instances >= 0.1 && < 0.4- , tasty >= 0.8 && < 0.12- , tasty-quickcheck >= 0.8 && < 0.9+ , tasty >= 0.8 && < 1.6+ , tasty-quickcheck >= 0.8 && < 0.11 hs-source-dirs: tests default-language: Haskell2010 ghc-options: -Wall
src/Control/Natural.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GADTs #-}@@ -32,11 +31,9 @@ import qualified Control.Category as C (Category(..)) -#if !(MIN_VERSION_base(4,8,0))-import Data.Monoid (Monoid(..))-#endif+#if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup (Semigroup(..))-import Data.Typeable+#endif --------------------------------------------------------------------------- -- Naming of ~>, :~> and $$ are taken (with permission) from Edward Kmett's @indexed@ package.@@ -49,7 +46,6 @@ infixr 0 :~>, $$ -- | A natural transformation suitable for storing in a container. newtype f :~> g = NT { ($$) :: f ~> g }- deriving Typeable instance C.Category (:~>) where id = NT id
src/Control/Natural/RULES.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE Trustworthy #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}+{-# OPTIONS_GHC -Wno-orphans #-} {-| Module: Control.Transformation.RULES
tests/Properties.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE TypeOperators #-} {-| Module: Main@@ -14,9 +13,6 @@ import Control.Natural import Data.Foldable (toList)-#if !(MIN_VERSION_base(4,8,0))-import Data.Monoid (Monoid(..))-#endif import Data.Sequence (Seq, fromList) import Test.QuickCheck.Instances ()@@ -34,7 +30,7 @@ ] -- | Verifies the free theorem for natural transformations, i.e., that--- +-- -- @ -- fmap h . r == r . fmap h -- @@@ -43,7 +39,7 @@ prop_freeTheorem h r t = fmap h (r # t) == (r # fmap h t) -- | Verifies that natural transformations form a law-abiding 'Monoid', i.e., that--- +-- -- * @mappend mempty x = x@ -- -- * @mappend x mempty = x@