purescript-lists
purescript-lists copied to clipboard
Linked Lists
I get why https://github.com/purescript/purescript-lists/blob/v6.0.0/src/Data/List/Lazy/Types.purs#L121 does what it does with reverse, but it seems to me there is no reason to create a brand new temporary lazy list just to consume...
A version of #199 using records instead of typeclasses. Addresses proposal in #183. WIP - A bit messy at the moment. Will make another PR with cleaner commit history, but...
**Description of the change** This PR demonstrates another testing strategy that accomplishes the following: * Encourages API consistency * It lets the compiler help us fix #183 and prevent future...
**Description of the change** Intended to be merged following #191 This changes some of the tests, examples, and other docs for consistency, comparability, and to highlight some subtle differences in...
I'm not sure if this is something you'd like to add, but I've found this construct useful in other languages that support explicit lazy lists. For example, both [rust](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.try_fold) and...
- [ ] some - [ ] many - [ ] sort - [ ] sortBy - [ ] group' - [x] replicate - [x] replicateM - [x] snoc -...
https://github.com/purescript/purescript-lists/blob/b113451e5b41cad87d669a3165f955c71cd863e2/src/Data/List/ZipList.purs#L57-L66 ZipList is Bind, in which join is just diagonal. It's also Monad and ~~MonadPlus~~. Example: https://try.purescript.org/?gist=4888527a78d71d12df75fa628acd4719
https://github.com/purescript/purescript-lists/blob/b113451e5b41cad87d669a3165f955c71cd863e2/src/Data/List/Lazy/Types.purs#L116 The implementation of FunctorWithIndex for Lazy List uses folding, which, unlike Functor, is not lazy. It should be: ```purescript instance functorWithIndexList :: FunctorWithIndex Int List where mapWithIndex f xs...
**Description of the change** Modified `toUnfoldable` in `Data.List.NonEmpty` and `Data.List.Lazy.NonEmpty` to have the signature `toUnfoldable :: forall f. Unfoldable1 f => NonEmptyList ~> f`, and reimplemented it accordingly. Additionally added...
**Description of the change** Rewrote the faulty ```purescript instance applyNonEmptyList :: Apply NonEmptyList where apply (NonEmptyList (f :| fs)) (NonEmptyList (a :| as)) = NonEmptyList (f a :| (fs a...