recursion 2.2.4.4 → 2.2.5.0
raw patch · 4 files changed
+33/−3 lines, 4 files
Files
- CHANGELOG.md +5/−0
- LICENSE +1/−1
- recursion.cabal +2/−2
- src/Control/Recursion.hs +25/−0
CHANGELOG.md view
@@ -1,5 +1,10 @@ # recursion +## 2.2.5.0++* Add `mpara`, `mzygo`, `mana`, `mapo`, `mfutu` for compatibility with+ recursion-schemes+ ## 2.2.4.4 * Augment documentation
LICENSE view
@@ -1,4 +1,4 @@-Copyright Vanessa McHale (c) 2018-2020+Copyright Vanessa McHale (c) 2018-2021 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
recursion.cabal view
@@ -1,9 +1,9 @@ cabal-version: 1.18 name: recursion-version: 2.2.4.4+version: 2.2.5.0 license: BSD3 license-file: LICENSE-copyright: Copyright: (c) 2018-2020 Vanessa McHale+copyright: Copyright: (c) 2018-2021 Vanessa McHale maintainer: vamchale@gmail.com author: Vanessa McHale bug-reports: https://hub.darcs.net/vmchale/recursion/issues
src/Control/Recursion.hs view
@@ -40,6 +40,11 @@ -- * Mendler-style recursion schemes , mhisto , mcata+ , mzygo+ , mpara+ , mana+ , mfutu+ , mapo -- * Monadic recursion schemes , cataM , anaM@@ -387,6 +392,26 @@ -- 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++-- | @since 2.2.5.0+mpara :: (forall y. (y -> c) -> (y -> Fix f) -> f y -> c) -> Fix f -> c+mpara ψ = c where c = ψ c id . unFix++-- | @since 2.2.5.0+mzygo :: (forall y. (y -> b) -> f y -> b) -> (forall y. (y -> c) -> (y -> b) -> f y -> c) -> Fix f -> c+mzygo φ ψ = c where c = ψ c (mcata φ) . unFix++-- | @since 2.2.5.0+mana :: (forall y. (x -> y) -> x -> f y) -> x -> Fix f+mana φ = c where c = Fix . φ c++-- | @since 2.2.5.0+mapo :: (forall y. (Fix f -> y) -> (x -> y) -> x -> f y) -> x -> Fix f+mapo φ = c where c = Fix . φ id c++-- | @since 2.2.5.0+mfutu :: (forall y. (f y -> y) -> (x -> y) -> x -> f y) -> x -> Fix f+mfutu φ = c where c = Fix . φ Fix c -- | Elgot algebra (see [this paper](https://arxiv.org/abs/cs/0609040)) --