Collection types
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- fsharp
- Domain
- tooling
Research direction
Start by reviewing Foldable.fs and Collection.fs, focusing on filter, ofSeq, ofList, and intersperse. Compare their abstraction requirements with the linked Haskell and PureScript explanations, then determine which functions belong in each module. Done means the collection functions are reorganized consistently without changing the intended API behavior.
Written by the indexing model from the issue text.
Description
This is a long standing design issue, however it doesn't seem to have any impact in usability, but the real impact seems to be that it's a bit confusing how to organize the source code.
The question arise on how can we unify List, Array, Seq and so on.
Foldable concentrates most operations but not all of them, for example singleton is not a Foldable operation, it seems to be exactly the opposite of a Foldable.
Then we have some stuff that falls in the middle, typically operations that take a "CollectionX" as input, do something and return the same type of "CollectionX".
There is lot of confusion because normally these collection types are required to be Foldable, but that requirement is not enough, they must belong at the same time to another abstraction.
Collection and Unfoldable abstractions seems to provide an answer, here's an explanation from a Haskell implementation and here's a Purescript implementation of Unfoldable
Reflecting over this, we can conclude (among many other things) that placing Filter in Foldable.fs is simply wrong. Filter seems to be one of the only functions from Collection, which means that is a Foldable and an Unfoldable at the same time.
So I propose to start organizing our functions accordingly. Starting to move to Foldable everything that is specific to Foldable but doesn't require Unfoldable, and what doesn't fall there should be moved into Collection.fs for now (later we can decide to partition it into Unfoldable.fs and Collection.fs).
I have the feeling that ofSeq (ofList as well) belongs to Unfoldable, see also: http://hackage.haskell.org/package/unfoldable-0.9.6/docs/Data-Unfoldable.html
If my memory serves me right, it was moved to Foldable because intersperse (which requires foldable and monoid as showed in purescript implementation) had a generic default overload that use ofSeq but this is an optimization, not a requirement. An optimization for Unfoldables, now we would have to move it to Collection.fs because of this which is more a technical limitation.
- Dominant language
- F#
- Stars
- 941
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fsprojects/FSharpPlus
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fsprojects/FSharpPlus#683 · 1 comment · 2 reactions ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
fsprojects/FSharpPlus#678 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fsprojects/FSharpPlus#644 ·
-
breaking change F#+ v2.0
Difficulty 4/5 3-5 days Newbie friendliness 30/100
fsprojects/FSharpPlus#643 ·
-
lens type signature Openbreaking change F#+ v2.0
Difficulty 3/5 1-2 days Newbie friendliness 35/100
fsprojects/FSharpPlus#641 ·
All issues in fsprojects/FSharpPlus
Similar issues
-
comp/cron P2 sweeper:risk-automation type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#117792 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
bancolombia/sentinel#20 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
alunduil/woodland-generators#669 ·