recursion 2.2.0.1 → 2.2.1.0
raw patch · 3 files changed
+46/−29 lines, 3 files
Files
- CHANGELOG.md +4/−0
- recursion.cabal +30/−29
- src/Control/Recursion.hs +12/−0
CHANGELOG.md view
@@ -1,5 +1,9 @@ # recursion +## 2.2.1.0++* Add `transverse` for parity with `recursion-schemes >= 5.1`+ ## 2.2.0.1 * Documentation fix
recursion.cabal view
@@ -1,39 +1,41 @@-cabal-version: 1.18-name: recursion-version: 2.2.0.1-license: BSD3-license-file: LICENSE-copyright: Copyright: (c) 2018 Vanessa McHale-maintainer: vanessa.mchale@iohk.io-author: Vanessa McHale-bug-reports: https://hub.darcs.net/vmchale/recursion/issues-synopsis: A recursion schemes library for GHC.+cabal-version: 1.18+name: recursion+version: 2.2.1.0+license: BSD3+license-file: LICENSE+copyright: Copyright: (c) 2018-2019 Vanessa McHale+maintainer: vanessa.mchale@iohk.io+author: Vanessa McHale+bug-reports: https://hub.darcs.net/vmchale/recursion/issues+synopsis: A recursion schemes library for GHC. description: A performant recursion schemes library for Haskell with minimal dependencies-category: Control, Recursion-build-type: Simple-extra-source-files: cabal.project.local-extra-doc-files:- README.md- CHANGELOG.md+category: Control, Recursion+build-type: Simple+extra-source-files:+ cabal.project.local+extra-doc-files: README.md+ CHANGELOG.md source-repository head- type: darcs+ type: darcs location: https://hub.darcs.net/vmchale/recursion flag development- description: Enable `-Werror`- default: False- manual: True+ description:+ Enable `-Werror`+ default: False+ manual: True library- exposed-modules: Control.Recursion- hs-source-dirs: src+ exposed-modules:+ Control.Recursion+ hs-source-dirs: src default-language: Haskell2010- other-extensions:- DeriveFunctor FlexibleContexts ExistentialQuantification RankNTypes- TypeFamilies DeriveFoldable DeriveTraversable- ghc-options: -Wall+ other-extensions: DeriveFunctor FlexibleContexts+ ExistentialQuantification RankNTypes TypeFamilies DeriveFoldable+ DeriveTraversable+ ghc-options: -Wall build-depends: base >=4.9 && <5, composition-prelude -any@@ -42,9 +44,8 @@ ghc-options: -Werror if impl(ghc >=8.0)- ghc-options:- -Wincomplete-uni-patterns -Wincomplete-record-updates- -Wredundant-constraints -Wnoncanonical-monad-instances+ ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates+ -Wredundant-constraints -Wnoncanonical-monad-instances if impl(ghc >=8.4) ghc-options: -Wmissing-export-lists
src/Control/Recursion.hs view
@@ -55,6 +55,7 @@ , colambek , hoist , refix+ , transverse ) where import Control.Arrow ((&&&))@@ -288,6 +289,17 @@ -- | Apomorphism. Compare 'micro'. apo :: (Corecursive t) => (a -> Base t (Either t a)) -> a -> t apo g = a where a = embed . fmap (either id a) . g++-- | Should satisfy:+--+-- @+-- 'transverse' 'sequenceA' = 'pure'+-- @+transverse :: (Recursive s, Corecursive t, Functor f)+ => (forall a. Base s (f a) -> f (Base t a))+ -> s+ -> f t+transverse = cata . (fmap embed .) hoist :: (Recursive s, Corecursive t) => (forall a. Base s a -> Base t a)