recursion 2.2.4.1 → 2.2.4.2
raw patch · 4 files changed
+19/−8 lines, 4 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +5/−0
- recursion.cabal +7/−4
- src/Control/Recursion.hs +4/−1
- src/Control/Recursion/GHC.hs +3/−3
CHANGELOG.md view
@@ -1,5 +1,10 @@ # recursion +## 2.2.4.2++* Drop support for Eta+* Works with GHC 9.0+ ## 2.2.4.1 * Add more doctests
recursion.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: recursion-version: 2.2.4.1+version: 2.2.4.2 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018-2019 Vanessa McHale@@ -28,7 +28,10 @@ manual: True library- exposed-modules: Control.Recursion+ exposed-modules:+ Control.Recursion+ Control.Recursion.GHC+ hs-source-dirs: src default-language: Haskell2010 other-extensions:@@ -41,8 +44,8 @@ base >=4.9 && <5, composition-prelude -any - if !impl(eta -any)- exposed-modules: Control.Recursion.GHC+ if impl(eta -any)+ buildable: False if (flag(development) && !impl(ghc >=8.8)) ghc-options: -Werror
src/Control/Recursion.hs view
@@ -64,12 +64,13 @@ import Control.Composition ((.*), (.**)) import Control.Monad ((<=<)) import Data.Foldable (toList)+import Data.Kind (Type) import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NE import GHC.Generics import Numeric.Natural (Natural) -type family Base t :: * -> *+type family Base t :: Type -> Type class (Functor (Base t)) => Recursive t where @@ -364,6 +365,8 @@ mcata ψ = mc where mc = ψ mc . unFix -- | Mendler's histomorphism+--+-- See [here](https://dl.acm.org/doi/pdf/10.1145/3409004) for an example mhisto :: (forall y. ((y -> c) -> (y -> f y) -> f y -> c)) -> Fix f -> c mhisto ψ = mh where mh = ψ mh unFix . unFix
src/Control/Recursion/GHC.hs view
@@ -17,19 +17,19 @@ => (forall a. Base s (f a) -> f (Base t a)) -> s -> f t-transverse = cata . (fmap embed .)+transverse η = cata (fmap embed . η) cotransverse :: (Recursive s, Corecursive t, Functor f) => (forall a. f (Base s a) -> Base t (f a)) -> f s -> t-cotransverse = ana . (. fmap project)+cotransverse η = ana (η . fmap project) hoist :: (Recursive s, Corecursive t) => (forall a. Base s a -> Base t a) -> s -> t-hoist = cata . (embed .)+hoist η = cata (embed . η) {-# NOINLINE [0] hoist #-} hoistMu :: (forall a. f a -> g a) -> Mu f -> Mu g