Proposal: Add monadic instances
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Domain
- backend
Research direction
Read the existing NonEmpty type and its current typeclass instances to assess the proposed Apply, Applicative, Bind, and Monad support. The issue also asks how to test typeclass laws, including whether to use purescript-quickcheck-laws; completion would require a maintainer decision on the approach and tests for the resulting instances.
Written by the indexing model from the issue text.
Description
Motivation
The current NonEmpty type does not provide Apply, Applicative, Bind, or Monad instances. However, a monadic interface appears feasible under suitable constraints on the underlying type constructor f.
Haskell's NonEmpty provides a useful precedent for monadic composition. In PureScript, the implementation would need to account for the underlying f structure and preserve the expected ordering and behavior of the resulting values.
Questions
- Would the maintainers be open to adding these instances?
- What is the preferred approach for testing typeclass laws? Is it recommended to use
purescript-quickcheck-lawsin the repository's existing test suite, or is there another best practice for this?
- Dominant language
- PureScript
- Stars
- 17
- Forks
- 25
- Avg merge
- 3d 10m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
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 purescript/purescript-nonempty
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
purescript/purescript-nonempty#53 · 2 comments ·
All issues in purescript/purescript-nonempty
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
milind-soni/OpenMausBot#5829 ·
Maintainers usually reply within 1 day