purescript-foldable-traversable
purescript-foldable-traversable copied to clipboard
Classes for foldable and traversable data structures
Should the signature of foldr1 (and similarly foldl1) be: ```purescript foldr1 :: forall f a b. Foldable1 f => (a -> b -> b) -> (a -> b) -> f...
**Description of the change** I created a function `foldlMaybe` because I noticed code duplication in `minimumBy` and `maximumBy` --- **Checklist:** - [ ] Added the change to the changelog's "Unreleased"...
foldRecM
Generalize from `Data.Array`: foldRecM :: forall m a b. Foldable f => MonadRec m => (a -> b -> m a) -> a -> f b -> m a
I just bumped into the problem mentioned here https://stackoverflow.com/a/38490637/3237351 and the solution was also indeed to go from `foldl = foldlDefault` to `fold f = foldlDefault f`. It feels like...
Examples in the documentation repeatedly use a function called `print`. Perhaps this should be changed to `log` or `logShow` or something along those lines?
I had an idea: What if instead of ``` Map.fromFoldable $ Map.toUnfoldable someMap ``` You could do: ``` unfoldWithIndex $ foldWithIndex someMap ``` where ``` foldWithIndex ∷ ∀ g f...
There is no documentation for the module. It would be nice to give library users a sense of what this is.
Parts of the code are very clearly inspired/copied from Haskell's `semigroupoids`, by @ekmett. Here is its license: https://github.com/ekmett/semigroupoids/blob/master/LICENSE It is probably worth mentioning this in the license for this repo.
In Haskell's `Data.Foldable`, a lot of the utility functions are class members, allowing for instances to define more efficient implementations. What do people think of potentially doing this here?