yaya 0.6.2.0 → 0.6.2.2
raw patch · 6 files changed
+391/−120 lines, 6 filesdep −foldable1-classes-compatdep ~basedep ~lensdep ~template-haskellsetup-changed
Dependencies removed: foldable1-classes-compat
Dependency ranges changed: base, lens, template-haskell, th-abstraction
Files
- CHANGELOG.md +39/−19
- README.md +204/−0
- Setup.hs +7/−2
- docs/license-report.md +69/−0
- src/Yaya/Retrofit.hs +1/−21
- yaya.cabal +71/−78
CHANGELOG.md view
@@ -2,42 +2,62 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),+The format is based on [Keep a Changelog 1.1](https://keepachangelog.com/en/1.1.0/), and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). -## 0.4.2.3 – 2024–01–11+## [0.6.2.2] - 2024-10-23 ### Changed +- simplified Template Haskell internals in `Yaya.Retrofit`++## [0.6.2.1] - 2024-08-26++### Added++- support for GHC 9.10++## [0.6.2.0] -++## [0.6.1.0] -++## [0.6.0.0] -++## [0.5.0.0] -++## [0.4.2.3] – 2024–01–11++### Changed+ - added CPP to support GHC 9.8 -## 0.4.2.2 – 2023–12–21+## [0.4.2.2] – 2023–12–21 ### Changed - updated formatting for newer Ormolu - fixed a Haddock typo -## 0.4.2.1+## [0.4.2.1] - Unknown changes. -## 0.4.2.0+## [0.4.2.0] - Unknown changes. -## 0.4.1.0+## [0.4.1.0] - Unknown changes. -## 0.4.0.1 – 2020–12–08+## [0.4.0.1] – 2020–12–08 ### Changed - updated explanation of differences from `recursion-schemes` - updated comments and parameter names in metamorphisms -## 0.4.0.0 – 2020–12–08+## [0.4.0.0] – 2020–12–08 ### Added @@ -48,62 +68,62 @@ - `while` is generalized and now called `definedOrInput` - `split` renamed to `diagonal` -## 0.3.2.0 – 2020–06–01+## [0.3.2.0] – 2020–06–01 ### Added - `zipAlgebraMs` -## 0.3.1.2 – 2020–05–18+## [0.3.1.2] – 2020–05–18 ### Added - `HFunctor` instances -## 0.3.1.1 – 2020–05–18+## [0.3.1.1] – 2020–05–18 ### Changed - Turned on StrictData -## 0.3.1.0 – 2020–05–18+## [0.3.1.0] – 2020–05–18 ### Added - Copied Kmett's auto-extraction of pattern functors -## 0.3.0.0 – 2020–05–14+## [0.3.0.0] – 2020–05–14 ### Changed - introduced minimal poly-kinding of type classes -## 0.2.1.3 – 2020–05–14+## [0.2.1.3] – 2020–05–14 ### Changed - enabled and fixed warnings -## 0.2.1.2 – 2019–11–08+## [0.2.1.2] – 2019–11–08 ### Changed - improved documentation -## 0.2.1.1 – 2019–11–08+## [0.2.1.1] – 2019–11–08 ### Added - documentation explaining limitations of `Mu` - tests for `law_cataCompose` (which bumps the yaya-hedgehog dependency for tests) -## 0.2.1.0 – 2019–01–08+## [0.2.1.0] – 2019–01–08 ### Added - exports of type class methods via `Yaya.Retrofit` -## 0.2.0.0 – 2019–01–08+## [0.2.0.0] – 2019–01–08 ### Added @@ -115,7 +135,7 @@ - moved `DFunctor` and `HFunctor` to a new `Yaya.Functor` module - renamed `cursiveIso` to `steppableIso` -## 0.1.0.0 – 2019–01–04+## [0.1.0.0] – 2019–01–04 ### Added
README.md view
@@ -1,7 +1,12 @@ # Yaya +[](https://repology.org/project/haskell:yaya/versions)+[](https://repology.org/project/haskell:yaya/versions)+ Yet another … yet another recursion scheme library for Haskell +Total recursion scheme library for Haskell.+ ## overview Recursion schemes allow you to separate _any_ recursion from your business logic, writing step-wise operations that can be applied in a way that guarantees termination (or, dually, progress).@@ -61,3 +66,202 @@ #### `M` Kleisli (“monadic”) variant – This convention is much more widespread than simply recursion schemes. A fold that returns its result in a `Monad`, by applying a Kleisli algebra (that is, `f a -> m a` rather than `f a -> a`. The dual of this might be something like `anaW` (taking a seed value in a `Comonad`), but those are uninteresting. Having Kleisli variants of unfolds is unsafe, as it can force traversal of an infinite structure. If you’re looking for an operation like that, you are better off with an effectful streaming library.++## versioning++This project largely follows the [Haskell Package Versioning Policy](https://pvp.haskell.org/) (PVP), but is more strict in some ways.++The version always has four components, `A.B.C.D`. The first three correspond to those required by PVP, while the fourth matches the “patch” component from [Semantic Versioning](https://semver.org/).++Here is a breakdown of some of the constraints:++### sensitivity to additions to the API++PVP recommends that clients follow [these import guidelines](https://wiki.haskell.org/Import_modules_properly) in order that they may be considered insensitive to additions to the API. However, this isn’t sufficient. We expect clients to follow these additional recommendations for API insensitivity++If you don’t follow these recommendations (in addition to the ones made by PVP), you should ensure your dependencies don’t allow a range of `C` values. That is, your dependencies should look like++```cabal+yaya >=1.2.3 && <1.2.4+```++rather than++```cabal+yaya >=1.2.3 && <1.3+```++#### use package-qualified imports everywhere++If your imports are [package-qualified](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/package_qualified_imports.html?highlight=packageimports#extension-PackageImports), then a dependency adding new modules can’t cause a conflict with modules you already import.++#### avoid orphans++Because of the transitivity of instances, orphans make you sensitive to your dependencies’ instances. If you have an orphan instance, you are sensitive to the APIs of the packages that define the class and the types of the instance.++One way to minimize this sensitivity is to have a separate package (or packages) dedicated to any orphans you have. Those packages can be sensitive to their dependencies’ APIs, while the primary package remains insensitive, relying on the tighter ranges of the orphan packages to constrain the solver.++### transitively breaking changes (increments `A`)++#### removing a type class instance++Type class instances are imported transitively, and thus changing them can impact packages that only have your package as a transitive dependency.++#### widening a dependency range with new major versions++This is a consequence of instances being transitively imported. A new major version of a dependency can remove instances, and that can break downstream clients that unwittingly depended on those instances.++A library _may_ declare that it always bumps the `A` component when it removes an instance (as this policy dictates). In that case, only `A` widenings need to induce `A` bumps. `B` widenings can be `D` bumps like other widenings, Alternatively, one may compare the APIs when widening a dependency range, and if no instances have been removed, make it a `D` bump.++### breaking changes (increments `B`)++#### restricting an existing dependency’s version range in any way++Consumers have to contend not only with our version bounds, but also with those of other libraries. It’s possible that some dependency overlapped in a very narrow way, and even just restricting a particular patch version of a dependency could make it impossible to find a dependency solution.++#### restricting the license in any way++Making a license more restrictive may prevent clients from being able to continue using the package.++#### adding a dependency++A new dependency may make it impossible to find a solution in the face of other packages dependency ranges.++### non-breaking changes (increments `C`)++#### adding a module++This is also what PVP recommends. However, unlike in PVP, this is because we recommend that package-qualified imports be used on all imports.++### other changes (increments `D`)++#### widening a dependency range for non-major versions++This is fairly uncommon, in the face of `^>=`-style ranges, but it can happen in a few situations.++#### deprecation++**NB**: This case is _weaker_ than PVP, which indicates that packages should bump their major version when adding `deprecation` pragmas.++We disagree with this because packages shouldn’t be _publishing_ with `-Werror`. The intent of deprecation is to indicate that some API _will_ change. To make that signal a major change itself defeats the purpose. You want people to start seeing that warning as soon as possible. The major change occurs when you actually remove the old API.++Yes, in development, `-Werror` is often (and should be) used. However, that just helps developers be aware of deprecations more immediately. They can always add `-Wwarn=deprecation` in some scope if they need to avoid updating it for the time being.++## licensing++This package is licensed under [The GNU AGPL 3.0 or later](./LICENSE). If you need a license for usage that isn’t covered under the AGPL, please contact [Greg Pfeil](mailto:greg@technomadic.org?subject=licensing%20yaya).++You should review the [license report](docs/license-report.md) for details about dependency licenses.++## comparisons++Other projects similar to this one, and how they differ.++### [Turtles](https://github.com/sellout/turtles)++**This project has been deprecated. Check out [Droste](https://github.com/higherkindness/droste) instead.**++Yaya is a sister library to Turtles – the same approach, but implemented in+Scala. Here are some differences to be aware of:++- the `Zoo` modules in Turtles are both larger and their use is more encouraged,+ because Scala’s inference makes it harder to use `gcata` etc. directly;+- the `Unsafe` and `Native` modules have different contents, because different+ structures are strict or lazy between the two languages. For example., in Scala,+ `scala.collection.immutable.List` is strict, so the `Recursive` instance is in+ `Native`, while the `Corecursive` instance is in `Unsafe`, but Haskell’s+ `Data.List` is lazy, so the `Corecursive` instance is in `Native` while the+ `Recursive` instance is in `Unsafe`.++### [recursion-schemes](https://github.com/ekmett/recursion-schemes)++#### poly-kinded folds++The `c` type parameter specifies the arrow to use, so while it's common to+specialize to `(->)`, other options can give you polymorphic recursion over+nested data types (for example., GADTs). Among other things, you can use this to define+folds of fixed-sized structures:++```haskell+data VectF elem a (i :: Nat) where+ EmptyVect :: VectF elem a 0+ VCons :: KnownNat n => elem -> a i -> VectF elem a (n + 1)++type Vect elem n = HMu (VectF elem) n+```++#### bias for totality++Yaya tries to encourage you to define things in ways that are likely to maintain+promises of termination. Sometimes, the compiler can even tell you when+you've broken these promises, but it falls short of any guarantee of totality.++Anything known to be partial is relegated to the `yaya-unsafe` package -- mostly+useful when you're in the process of converting existing directly-recursive+code.++**NB**: There are a number of instances (for example, `Corecursive [a] (XNor a)`) that+_are_ actually safe, but they rely on Haskell’s own recursion. We could+potentially add a module/package in between the safe and unsafe ones, containing+`Corecursive` instances for types that are lazy in their recursive parameters+and `Recursive` instances for ones that are strict.++#### bias for working with algebras++We try to provide fewer fold operations (although all the usual ones can be+found in the `Zoo` modules). Instead, we expect more usage of `gcata`, and we+provide a collection of "algebra transformers" to make it easier to transform+various functions into generalized algebras, and between different generalized+algebras to maximize the opportunities for fusion. Although, more importantly,+it allows you to write "proto-algebras", which are functions that you expect to+use in a fold but that aren't strictly in the shape of an algebra.++#### productive metamorphisms++Yaya has productive metamorphisms (see `streamAna` and `streamGApo` -- also+`stream` and `fstream` for more specialized versions). The naïve composition of+`cata` and `ana` has no benefits.++#### more atomic classes++recursion-schemes combines `cata` and `project` into a single type+class. However, the laws for `project` require either `embed` or `ana`, never+`cata`. Similarly, the laws for `cata` either stand alone or require `embed`,+never `project`. And you can restate this paragraph, replacing each operation+with its dual.++Also, it's impossible to define `embed` for some pattern functors where it's+still possible to define `project`, so `project` and `embed` need to be+independent.++One unfortunate consequence of the above conditions is that `Projectable` is+lawless on its own. However, we expect there to be a corresponding instance of+either `Corecursive` or `Steppable` in all cases.++#### multi-parameter type classes++A purely ergonomic difference, yaya uses multi-parameter type classes instead of+a `Base` type family.++The latter frequently requires constraints in the form of+`(Recursive t, Base t ~ f)`, so we prefer `Recursive t f`.++#### naming++Pattern functors and algebras tend to be named independently of their+fixed-points. For example, we use `Maybe` directly instead of some `NatF`, `XNor a b`+instead of `ListF`, and `AndMaybe a b` instead of `NonEmptyF`.++This is because many pattern functors and algebras can be applied differently in+different situations, so we try to avoid pigeon-holing them and rather trying to+understand what the definition itself means, rather than in the context of a+fold.++### [compdata](https://github.com/pa-ba/compdata)++I’m not as familiar with compdata, so I’ll have to look at it more before+fleshing this out.++- poly-kinded recursion schemes instead of separate classes for type-indexed+ recursion schemes. Using `PolyKinds` also allows for a wider variety of folds,+ for example, where the type index has kind `Type -> Type` rather than kind `Type`.
Setup.hs view
@@ -1,12 +1,17 @@--- __NB__: `custom-setup` doesn’t have any way to specify extensions, so any we--- want need to be specified here.+-- __NB__: `custom-setup` doesn’t have any way to specify extensions or options,+-- so any we want need to be specified here.+{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude #-}+#if MIN_VERSION_GLASGOW_HASKELL(8, 0, 0, 0) {-# OPTIONS_GHC -Weverything #-} -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-}+#else+{-# OPTIONS_GHC -Wall #-}+#endif module Main (main) where
+ docs/license-report.md view
@@ -0,0 +1,69 @@+**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [`cabal-plan license-report`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative.++# Dependency License Report++Bold-faced **`package-name`**s denote standard libraries bundled with `ghc-9.10.1`.++## Direct dependencies of `yaya:lib:yaya`++| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Also depended upon by |+| --- | --- | --- | --- | --- |+| **`base`** | [`4.20.0.0`](http://hackage.haskell.org/package/base-4.20.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/base-4.20.0.0/src/LICENSE) | Core data structures and operations | *(core library)* |+| `comonad` | [`5.0.8`](http://hackage.haskell.org/package/comonad-5.0.8) | [`BSD-3-Clause`](http://hackage.haskell.org/package/comonad-5.0.8/src/LICENSE) | Comonads | `adjunctions`, `bifunctors`, `free`, `invariant`, `kan-extensions`, `lens`, `profunctors`, `semigroupoids` |+| `either` | [`5.0.2`](http://hackage.haskell.org/package/either-5.0.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/either-5.0.2/src/LICENSE) | Combinators for working with sums | |+| `free` | [`5.2`](http://hackage.haskell.org/package/free-5.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/free-5.2/src/LICENSE) | Monads for free | `adjunctions`, `kan-extensions`, `lens` |+| `kan-extensions` | [`5.2.6`](http://hackage.haskell.org/package/kan-extensions-5.2.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/kan-extensions-5.2.6/src/LICENSE) | Kan extensions, Kan lifts, the Yoneda lemma, and (co)density (co)monads | `lens` |+| `lens` | [`5.3.2`](http://hackage.haskell.org/package/lens-5.3.2) | [`BSD-2-Clause`](http://hackage.haskell.org/package/lens-5.3.2/src/LICENSE) | Lenses, Folds and Traversals | |+| `profunctors` | [`5.6.2`](http://hackage.haskell.org/package/profunctors-5.6.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/profunctors-5.6.2/src/LICENSE) | Profunctors | `adjunctions`, `either`, `free`, `invariant`, `kan-extensions`, `lens` |+| `strict` | [`0.5.1`](http://hackage.haskell.org/package/strict-0.5.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/strict-0.5.1/src/LICENSE) | Strict data types and String IO. | `lens` |+| **`template-haskell`** | [`2.22.0.0`](http://hackage.haskell.org/package/template-haskell-2.22.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/template-haskell-2.22.0.0/src/LICENSE) | Support library for Template Haskell | `OneTuple`, `bifunctors`, `bytestring`, `containers`, `exceptions`, `filepath`, `free`, `invariant`, `lens`, `os-string`, `primitive`, `reflection`, `semigroupoids`, `tagged`, `text`, `th-abstraction`, `unordered-containers` |+| `th-abstraction` | [`0.7.0.0`](http://hackage.haskell.org/package/th-abstraction-0.7.0.0) | [`ISC`](http://hackage.haskell.org/package/th-abstraction-0.7.0.0/src/LICENSE) | Nicer interface for reified information about data types | `bifunctors`, `free`, `invariant`, `lens` |+| **`transformers`** | [`0.6.1.1`](http://hackage.haskell.org/package/transformers-0.6.1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-0.6.1.1/src/LICENSE) | Concrete functor and monad transformers | `StateVar`, `adjunctions`, `bifunctors`, `comonad`, `contravariant`, `distributive`, `exceptions`, `free`, `indexed-traversable`, `invariant`, `kan-extensions`, `lens`, `mtl`, `primitive`, `profunctors`, `semigroupoids`, `strict`, `tagged`, `transformers-base`, `transformers-compat` |++## Indirect transitive dependencies++| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Depended upon by |+| --- | --- | --- | --- | --- |+| `OneTuple` | [`0.4.2`](http://hackage.haskell.org/package/OneTuple-0.4.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/OneTuple-0.4.2/src/LICENSE) | Singleton Tuple | `indexed-traversable-instances` |+| `StateVar` | [`1.2.2`](http://hackage.haskell.org/package/StateVar-1.2.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/StateVar-1.2.2/src/LICENSE) | State variables | `contravariant`, `invariant` |+| `adjunctions` | [`4.4.2`](http://hackage.haskell.org/package/adjunctions-4.4.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/adjunctions-4.4.2/src/LICENSE) | Adjunctions and representable functors | `kan-extensions` |+| **`array`** | [`0.5.7.0`](http://hackage.haskell.org/package/array-0.5.7.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/array-0.5.7.0/src/LICENSE) | Mutable and immutable arrays | `adjunctions`, `binary`, `containers`, `deepseq`, `indexed-traversable`, `invariant`, `kan-extensions`, `lens`, `parallel`, `stm`, `text` |+| `assoc` | [`1.1.1`](http://hackage.haskell.org/package/assoc-1.1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/assoc-1.1.1/src/LICENSE) | swap and assoc: Symmetric and Semigroupy Bifunctors | `bifunctors`, `lens`, `strict`, `these` |+| `base-orphans` | [`0.9.2`](http://hackage.haskell.org/package/base-orphans-0.9.2) | [`MIT`](http://hackage.haskell.org/package/base-orphans-0.9.2/src/LICENSE) | Backwards-compatible orphan instances for base | `distributive`, `lens`, `profunctors`, `semigroupoids`, `transformers-base` |+| `bifunctors` | [`5.6.2`](http://hackage.haskell.org/package/bifunctors-5.6.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/bifunctors-5.6.2/src/LICENSE) | Bifunctors | `either`, `invariant`, `lens`, `profunctors`, `semigroupoids` |+| **`binary`** | [`0.8.9.2`](http://hackage.haskell.org/package/binary-0.8.9.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/binary-0.8.9.2/src/LICENSE) | Binary serialisation for Haskell values using lazy ByteStrings | `strict`, `text`, `these` |+| **`bytestring`** | [`0.12.1.0`](http://hackage.haskell.org/package/bytestring-0.12.1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/bytestring-0.12.1.0/src/LICENSE) | Fast, compact, strict and lazy byte strings with a list interface | `binary`, `filepath`, `hashable`, `lens`, `os-string`, `strict`, `text` |+| `call-stack` | [`0.4.0`](http://hackage.haskell.org/package/call-stack-0.4.0) | [`MIT`](http://hackage.haskell.org/package/call-stack-0.4.0/src/LICENSE) | Use GHC call-stacks in a backward compatible way | `lens` |+| **`containers`** | [`0.7`](http://hackage.haskell.org/package/containers-0.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/containers-0.7/src/LICENSE) | Assorted concrete container types | `adjunctions`, `bifunctors`, `binary`, `comonad`, `free`, `hashable`, `indexed-traversable`, `invariant`, `kan-extensions`, `lens`, `parallel`, `semigroupoids`, `th-abstraction` |+| `contravariant` | [`1.5.5`](http://hackage.haskell.org/package/contravariant-1.5.5) | [`BSD-3-Clause`](http://hackage.haskell.org/package/contravariant-1.5.5/src/LICENSE) | Contravariant functors | `adjunctions`, `invariant`, `kan-extensions`, `lens`, `profunctors`, `semigroupoids` |+| **`deepseq`** | [`1.5.0.0`](http://hackage.haskell.org/package/deepseq-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/deepseq-1.5.0.0/src/LICENSE) | Deep evaluation of data structures | `bytestring`, `containers`, `filepath`, `hashable`, `os-string`, `parallel`, `pretty`, `primitive`, `strict`, `tagged`, `text`, `these`, `unordered-containers`, `vector` |+| `distributive` | [`0.6.2.1`](http://hackage.haskell.org/package/distributive-0.6.2.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/distributive-0.6.2.1/src/LICENSE) | Distributive functors -- Dual to Traversable | `adjunctions`, `comonad`, `free`, `kan-extensions`, `lens`, `profunctors`, `semigroupoids` |+| **`exceptions`** | [`0.10.7`](http://hackage.haskell.org/package/exceptions-0.10.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/exceptions-0.10.7/src/LICENSE) | Extensible optionally-pure exceptions | `filepath`, `free`, `lens`, `os-string` |+| **`filepath`** | [`1.5.2.0`](http://hackage.haskell.org/package/filepath-1.5.2.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/filepath-1.5.2.0/src/LICENSE) | Library for manipulating FilePaths in a cross platform way. | `hashable`, `lens` |+| **`ghc-bignum`** | [`1.3`](http://hackage.haskell.org/package/ghc-bignum-1.3) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-bignum-1.3/src/LICENSE) | GHC BigNum library | `ghc-internal`, `hashable` |+| **`ghc-boot-th`** | [`9.10.1`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1/src/LICENSE) | Shared functionality between GHC and the @template-haskell@ library | `template-haskell` |+| **`ghc-internal`** | [`9.1001.0`](http://hackage.haskell.org/package/ghc-internal-9.1001.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-internal-9.1001.0/src/LICENSE) | Basic libraries | `base` |+| **`ghc-prim`** | [`0.11.0`](http://hackage.haskell.org/package/ghc-prim-0.11.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-prim-0.11.0/src/LICENSE) | GHC primitives | *(core library)* |+| `hashable` | [`1.5.0.0`](http://hackage.haskell.org/package/hashable-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/hashable-1.5.0.0/src/LICENSE) | A class for types that can be converted to a hash value | `lens`, `semigroupoids`, `strict`, `these`, `unordered-containers` |+| `indexed-traversable` | [`0.1.4`](http://hackage.haskell.org/package/indexed-traversable-0.1.4) | [`BSD-2-Clause`](http://hackage.haskell.org/package/indexed-traversable-0.1.4/src/LICENSE) | FunctorWithIndex, FoldableWithIndex, TraversableWithIndex | `comonad`, `free`, `indexed-traversable-instances`, `lens` |+| `indexed-traversable-instances` | [`0.1.2`](http://hackage.haskell.org/package/indexed-traversable-instances-0.1.2) | [`BSD-2-Clause`](http://hackage.haskell.org/package/indexed-traversable-instances-0.1.2/src/LICENSE) | More instances of FunctorWithIndex, FoldableWithIndex, TraversableWithIndex | `lens` |+| `invariant` | [`0.6.3`](http://hackage.haskell.org/package/invariant-0.6.3) | [`BSD-2-Clause`](http://hackage.haskell.org/package/invariant-0.6.3/src/LICENSE) | Haskell98 invariant functors | `kan-extensions` |+| **`mtl`** | [`2.3.1`](http://hackage.haskell.org/package/mtl-2.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/mtl-2.3.1/src/LICENSE) | Monad classes for transformers, using functional dependencies | `adjunctions`, `either`, `exceptions`, `free`, `kan-extensions`, `lens` |+| **`os-string`** | [`2.0.2`](http://hackage.haskell.org/package/os-string-2.0.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/os-string-2.0.2/src/LICENSE) | Library for manipulating Operating system strings. | `filepath`, `hashable` |+| `parallel` | [`3.2.2.0`](http://hackage.haskell.org/package/parallel-3.2.2.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/parallel-3.2.2.0/src/LICENSE) | Parallel programming library | `lens` |+| **`pretty`** | [`1.1.3.6`](http://hackage.haskell.org/package/pretty-1.1.3.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/pretty-1.1.3.6/src/LICENSE) | Pretty-printing library | `template-haskell` |+| `primitive` | [`0.9.0.0`](http://hackage.haskell.org/package/primitive-0.9.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/primitive-0.9.0.0/src/LICENSE) | Primitive memory-related operations | `vector` |+| `reflection` | [`2.1.8`](http://hackage.haskell.org/package/reflection-2.1.8) | [`BSD-3-Clause`](http://hackage.haskell.org/package/reflection-2.1.8/src/LICENSE) | Reifies arbitrary terms into types that can be reflected back into terms | `lens` |+| `semigroupoids` | [`6.0.1`](http://hackage.haskell.org/package/semigroupoids-6.0.1) | [`BSD-2-Clause`](http://hackage.haskell.org/package/semigroupoids-6.0.1/src/LICENSE) | Semigroupoids: Category sans id | `adjunctions`, `either`, `free`, `kan-extensions`, `lens` |+| `semigroups` | [`0.20`](http://hackage.haskell.org/package/semigroups-0.20) | [`BSD-3-Clause`](http://hackage.haskell.org/package/semigroups-0.20/src/LICENSE) | Anything that associates | `adjunctions` |+| **`stm`** | [`2.5.3.1`](http://hackage.haskell.org/package/stm-2.5.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/stm-2.5.3.1/src/LICENSE) | Software Transactional Memory | `StateVar`, `exceptions`, `invariant`, `transformers-base` |+| `tagged` | [`0.8.8`](http://hackage.haskell.org/package/tagged-0.8.8) | [`BSD-3-Clause`](http://hackage.haskell.org/package/tagged-0.8.8/src/LICENSE) | Haskell 98 phantom types to avoid unsafely passing dummy arguments | `adjunctions`, `bifunctors`, `comonad`, `distributive`, `indexed-traversable-instances`, `invariant`, `kan-extensions`, `lens`, `profunctors`, `semigroupoids` |+| **`text`** | [`2.1.1`](http://hackage.haskell.org/package/text-2.1.1) | [`BSD-2-Clause`](http://hackage.haskell.org/package/text-2.1.1/src/LICENSE) | An efficient packed Unicode text type. | `hashable`, `lens`, `strict` |+| `these` | [`1.2.1`](http://hackage.haskell.org/package/these-1.2.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/these-1.2.1/src/LICENSE) | An either-or-both data type. | `lens`, `strict` |+| `transformers-base` | [`0.4.6`](http://hackage.haskell.org/package/transformers-base-0.4.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-base-0.4.6/src/LICENSE) | Lift computations from the bottom of a transformer stack | `free` |+| `transformers-compat` | [`0.7.2`](http://hackage.haskell.org/package/transformers-compat-0.7.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-compat-0.7.2/src/LICENSE) | A small compatibility shim for the transformers library | `adjunctions`, `comonad`, `invariant`, `lens`, `semigroupoids`, `transformers-base` |+| `unordered-containers` | [`0.2.20`](http://hackage.haskell.org/package/unordered-containers-0.2.20) | [`BSD-3-Clause`](http://hackage.haskell.org/package/unordered-containers-0.2.20/src/LICENSE) | Efficient hashing-based container types | `indexed-traversable-instances`, `invariant`, `lens`, `semigroupoids` |+| `vector` | [`0.13.1.0`](http://hackage.haskell.org/package/vector-0.13.1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/vector-0.13.1.0/src/LICENSE) | Efficient Arrays | `indexed-traversable-instances`, `lens` |+| `vector-stream` | [`0.1.0.1`](http://hackage.haskell.org/package/vector-stream-0.1.0.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/vector-stream-0.1.0.1/src/LICENSE) | Efficient Streams | `vector` |+| `void` | [`0.7.3`](http://hackage.haskell.org/package/void-0.7.3) | [`BSD-3-Clause`](http://hackage.haskell.org/package/void-0.7.3/src/LICENSE) | A Haskell 98 logically uninhabited data type | `adjunctions` |+
src/Yaya/Retrofit.hs view
@@ -68,7 +68,6 @@ validationToEither, ) import safe qualified "template-haskell" Language.Haskell.TH as TH-import safe qualified "template-haskell" Language.Haskell.TH.Syntax as TH.Syn import safe qualified "th-abstraction" Language.Haskell.TH.Datatype as TH.Abs import safe "this" Yaya.Fold ( Corecursive (ana),@@ -236,10 +235,7 @@ pure $ TH.DerivClause (pure TH.StockStrategy)- [ TH.ConT functorTypeName,- TH.ConT foldableTypeName,- TH.ConT traversableTypeName- ]+ [TH.ConT ''Foldable, TH.ConT ''Functor, TH.ConT ''Traversable] -- | A restricted version of `TH.Abs.DatatypeVariant` that excludes data family -- declarations.@@ -472,19 +468,3 @@ TH.Abs.UnspecifiedStrictness -> TH.NoSourceStrictness TH.Abs.Lazy -> TH.SourceLazy TH.Abs.Strict -> TH.SourceStrict------------------------------------------------------------------------------------ Manually quoted names----------------------------------------------------------------------------------- By manually generating these names we avoid needing to use the--- TemplateHaskell language extension when compiling this library.--- This allows the library to be used in stage1 cross-compilers.--functorTypeName :: TH.Name-functorTypeName = TH.Syn.mkNameG_tc "base" "GHC.Base" "Functor"--foldableTypeName :: TH.Name-foldableTypeName = TH.Syn.mkNameG_tc "base" "Data.Foldable" "Foldable"--traversableTypeName :: TH.Name-traversableTypeName = TH.Syn.mkNameG_tc "base" "Data.Traversable" "Traversable"
yaya.cabal view
@@ -1,66 +1,71 @@-cabal-version: 3.0+cabal-version: 3.0 -name: yaya-version: 0.6.2.0-synopsis: Total recursion schemes.+name: yaya+version: 0.6.2.2+synopsis: Total recursion schemes. description: Recursion schemes allow you to separate recursion from your business logic – making your own operations simpler, more modular, and less error-prone. This library also provides tools for combining your operations in ways that reduce the number of passes over your data and is designed to encourage total (i.e., successfully terminating) functions.-author: Greg Pfeil <greg@technomadic.org>-maintainer: Greg Pfeil <greg@technomadic.org>-copyright: 2017 Greg Pfeil-homepage: https://github.com/sellout/yaya#readme+author: Greg Pfeil <greg@technomadic.org>+maintainer: Greg Pfeil <greg@technomadic.org>+copyright: 2017 Greg Pfeil+homepage: https://github.com/sellout/yaya#readme bug-reports: https://github.com/sellout/yaya/issues-category: Recursion-build-type: Custom-license: AGPL-3.0-or-later+category: Recursion+build-type: Custom+license: AGPL-3.0-or-later license-files: LICENSE-extra-source-files:+extra-doc-files: CHANGELOG.md README.md+ docs/*.md tested-with: GHC == {--- GHCup Nixpkgs 8.6.1,- 8.8.1, 8.8.4,- 8.10.1,- 9.0.1,- 9.2.1,- 9.4.1, 9.4.8,- 9.6.1,- 9.8.1+ 8.8.1,+ 8.10.1, 8.10.7,+ 9.0.1, 9.0.2,+ 9.2.1, 9.2.5,+ 9.4.1, 9.4.5,+ 9.6.1, 9.6.3,+ 9.8.1,+ 9.10.1 } source-repository head type: git location: https://github.com/sellout/yaya --- This mimics the GHC2021 extension--- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2021),+-- This mimics the GHC2024 extension+-- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2024), -- but supporting compilers back to GHC 7.10. If the oldest supported compiler--- is GHC 9.2, then this stanza can be removed and `import: GHC2021` can be--- replaced by `default-language: GHC2021`.-common GHC2021+-- is GHC 9.10, then this stanza can be removed and `import: GHC2024` can be+-- replaced by `default-language: GHC2024`. If the oldest supported compiler is+-- GHC 9.2, then this can be simplified by setting `default-language: GHC2021`+-- and only including the extensions added by GHC2024.+common GHC2024 default-language: Haskell2010 default-extensions: BangPatterns BinaryLiterals ConstraintKinds+ DataKinds DeriveDataTypeable DeriveGeneric -- DeriveLift -- uncomment if the oldest supported version is GHC 8.10.1+ DeriveTraversable DerivingStrategies+ DisambiguateRecordFields DoAndIfThenElse EmptyCase ExistentialQuantification FlexibleContexts FlexibleInstances- GADTSyntax+ GADTs GeneralizedNewtypeDeriving HexFloatLiterals -- ImportQualifiedPost -- uncomment if the oldest supported version is GHC 8.10.1+@@ -76,6 +81,7 @@ PolyKinds PostfixOperators RankNTypes+ RoleAnnotations ScopedTypeVariables StandaloneDeriving -- StandaloneKindSignatures -- uncomment if the oldest supported version is GHC 8.10.1+@@ -83,23 +89,29 @@ TypeApplications TypeOperators UnicodeSyntax- NoExplicitNamespaces +flag noisy-deprecations+ description:+ Prior to GHC 9.10, the `DEPRECATED` pragma can’t distinguish between terms+ and types. Consenquently, you can get spurious warnings when there’s a name+ collision and the name in the other namespace is deprecated. Or you can+ choose to not get those warnings, at the risk of not being warned when+ there’s a name collision and the namespace you’re referencing is the one+ that’s deprecated.+ common defaults- import: GHC2021+ import: GHC2024 build-depends:- base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0},+ base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, ghc-options: -Weverything+ -- This one just reports unfixable things, AFAICT.+ -Wno-all-missed-specialisations -- Type inference good. -Wno-missing-local-signatures -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 -Wno-unsafe- -- TODO: prune these warnings- -Wno-all-missed-specialisations- -fpackage-trust- -trust base if impl(ghc < 8.8.1) ghc-options: -- This used to warn even when `Safe` was explicit.@@ -110,8 +122,6 @@ -Wno-inferred-safe-imports -- We support GHC versions without qualified-post. -Wno-prepositive-qualified-module- -- `-trust` triggers this warning when applied to transitive dependencies.- -Wno-unused-packages if impl(ghc >= 9.2.1) ghc-options: -- We support GHC versions without kind signatures.@@ -123,6 +133,7 @@ -- Inference good. -Wno-missing-role-annotations default-extensions:+ BlockArguments DefaultSignatures ExplicitNamespaces FunctionalDependencies@@ -134,7 +145,6 @@ -- QualifiedDo - uncomment if the oldest supported version is GHC 9.0.1+ RecursiveDo -- RequiredTypeArguments - uncomment if the oldest supported version is GHC 9.10.1+- RoleAnnotations StrictData TemplateHaskellQuotes TransformListComp@@ -142,18 +152,35 @@ NoImplicitPrelude NoMonomorphismRestriction NoPatternGuards+ NoStarIsType NoTypeApplications+ if flag(noisy-deprecations)+ cpp-options: -DSELLOUT_NOISY_DEPRECATIONS custom-setup setup-depends: -- TODO: Remove `Cabal` dep once haskell/cabal#3751 is fixed.- Cabal ^>= {3.0.0, 3.2.0, 3.4.0, 3.6.0, 3.8.0, 3.10.0},- base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0},+ Cabal ^>= {3.0.0, 3.2.0, 3.4.0, 3.6.0, 3.8.0, 3.10.0, 3.12.0},+ base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, cabal-doctest ^>= {1.0.0}, library import: defaults hs-source-dirs: src+ build-depends:+ comonad ^>= 5.0.7,+ either ^>= 5,+ free ^>= {5.1.5, 5.2},+ kan-extensions ^>= 5.2,+ -- `Control.Lens` in lens < 5 is `Unsafe`+ lens ^>= {5, 5.1, 5.2, 5.3},+ profunctors ^>= {5.5.2, 5.6},+ -- strict < 0.4 doesn’t export various combinators+ strict ^>= {0.4, 0.5},+ template-haskell ^>= {2.14.0, 2.15.0, 2.16.0, 2.17.0, 2.18.0, 2.19.0, 2.20.0, 2.21.0, 2.22.0},+ -- th-abstraction < 0.3 has different field names+ th-abstraction ^>= {0.4.1, 0.5.0, 0.6.0, 0.7.0},+ transformers ^>= {0.5.5, 0.6.1}, exposed-modules: Yaya.Applied Yaya.Experimental.Foldable@@ -166,45 +193,6 @@ Yaya.Zoo other-modules: Yaya.Fold.Native.Internal- build-depends:- comonad ^>= 5.0.7,- either ^>= 5,- free ^>= {5.1.5, 5.2},- kan-extensions ^>= 5.2,- -- `Control.Lens` in lens < 5 is `Unsafe`- lens ^>= {5, 5.1, 5.2},- profunctors ^>= {5.5.2, 5.6},- -- strict < 0.4 doesn’t export various combinators- strict ^>= {0.4, 0.5},- template-haskell ^>= {2.14.0, 2.15.0, 2.16.0, 2.17.0, 2.18.0, 2.19.0, 2.20.0, 2.21.0},- -- th-abstraction < 0.3 has different field names- th-abstraction ^>= {0.4.1, 0.6.0},- transformers ^>= {0.5.5, 0.6.1},- -- NB: foldable-classes-compat is a transitive dependency … depending on- -- which version of other dependencies (specifically,- -- indexed-traversable) we select. However, `-trust` only works for- -- packages in the dependency graph, so we make it explicit here for the- -- times that it doesn’t get included transitively.- foldable1-classes-compat ^>= {0.1},- ghc-options:- -trust adjunctions- -trust array- -trust base-orphans- -trust binary- -trust bytestring- -trust containers- -trust distributive- -trust exceptions- -trust foldable1-classes-compat- -trust ghc-prim- -trust hashable- -trust lens- -trust profunctors- -trust semigroupoids- -trust stm- -trust template-haskell- -trust text- -trust transformers-compat test-suite doctests import: defaults@@ -214,6 +202,12 @@ build-depends: doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, yaya,+ if impl(ghc >= 8.10.1)+ ghc-options:+ -- `doctest` requires the package containing the doctests as a dependency+ -- to ensure it gets built before this test-suite, even though the package+ -- appears to be unused.+ -Wno-unused-packages -- TODO: The sections below here are necessary because we don’t have control -- over the generated `Build_doctests.hs` file. So we have to silence -- all of its warnings one way or another.@@ -223,7 +217,6 @@ -Wno-safe if impl(ghc >= 8.8.1) ghc-options:- -- This used to warn even when `Safe` was explicit. -Wno-missing-deriving-strategies default-extensions: -- Since we can’t add `{-# LANGUAGE Safe -#}` to the generated