Add Failure-based type class instances to document why some instances can not exist

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Domain
backend

Research direction

Review the existing instances for Map, Set, and NonEmptySet, then identify which type classes cannot preserve their Ord invariants. For each case, determine the appropriate Fail-based instance and confirm that using it reports the underlying issue and the proper alternative.

Written by the indexing model from the issue text.

Description

Per #71, an attempt was made to add Bifunctor to Map. While the implementation could be written that would type-check, the issue is that implementation wouldn't maintain the Ord invariant.

To document this issue, we should add instances for such type classes where the instance depends on a Fail constraint. Then if one uses the instance, they'll get notified of the underlying issue along with the proper way to do X.

We should list all the instances (if any) that should be added in this way for each type below:

  • Map
  • Set
  • NonEmptySet
Dominant language
PureScript
Stars
38
Forks
27
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from purescript/purescript-ordered-collections

All issues in purescript/purescript-ordered-collections

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.