Add `spanAntitoneM`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 28/100
Research direction
Start by reading the existing spanAntitone entry point and its tests, then compare how the proposed monadic signature would preserve the stated antitone rule. Done means adding spanAntitoneM with the specified type and behavior for effectful predicates, with coverage for the crossover result.
Written by the indexing model from the issue text.
Description
spanAntitone :: (k -> Bool) -> Map k a -> (Map k a, Map k a) is a handy way to "bisect" arbitrary data in the git bisect sense. Just stick your data in a Map, then use spanAntitone to find the crossover point.
Sometimes the antitone predicate cannot be defined purely though (maybe it involves interactivity, or consulting a database, or whatever), and in such cases I feel like it'd be handy to have this slight variation:
spanAntitoneM :: Monad m => (k -> m Bool) -> Map k a -> m (Map k a, Map k a)
The rule for the predicate can still be specified as j < k implies (>=) <$> p j <*> p k == f True, for some f :: forall x. x -> m x (roughly, (>=) <$> p j <*> p k always "resolves" to True).
- Dominant language
- Haskell
- Stars
- 356
- Forks
- 195
- Avg merge
- 3d 42m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the 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 haskell/containers
-
major-release strictness Tree
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
haskell/containers#1260 ·
-
Map performance Set
Difficulty 5/5 Over a week Newbie friendliness 35/100
haskell/containers#1263 · 4 comments ·
-
low-hanging-fruit performance Seq
Difficulty 4/5 3-5 days Newbie friendliness 43/100
haskell/containers#1262 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
haskell/containers#1261 · 11 comments ·
-
IntSet low-hanging-fruit performance
Difficulty 3/5 1-2 days Newbie friendliness 58/100
haskell/containers#1251 ·
All issues in haskell/containers
Similar issues
-
A `--symbolic` entry binding `𝑛3` and `!n3` passes the load check, since `once` compares spellings, and fails mid-run with a `user error`Possibly taken @sherenkov claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
objectionary/phino#1929 · 1 comment ·
Maintainers usually reply within 1 day
-
CJK text is italicizedPossibly taken @daniel-gregg claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 4 days
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
simplex-chat/simplex-chat#7714 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days