unfoldTree is too lazy
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in containers/src/Data/Tree.hs at lines 490-491 and inspect how unfoldTree constructs a Node. Compare its behavior with unfoldM and the unfoldr examples in the issue. Done means unfoldTree evaluates the tuple strictly enough to match those behaviors, while accounting for the noted breaking change.
Written by the indexing model from the issue text.
Description
To produce a Node, we should be strict in the tuple.
The current behavior does not match with unfoldM, e.g.
> import Data.Tree
> unfoldTree undefined undefined
Node {rootLabel = *** Exception: Prelude.undefined
> import Data.Functor.Identity
> runIdentity $ unfoldTreeM @Identity undefined undefined
*** Exception: Prelude.undefined
Or with other unfold functions like
> import Data.List
> unfoldr (\_ -> Just undefined) undefined
*** Exception: Prelude.undefined
This will be a breaking change, but it is also unlikely that someone is depending on this excessive laziness.
- Dominant language
- Haskell
- Stars
- 355
- Forks
- 194
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 7
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
-
IntSet low-hanging-fruit performance
Difficulty 3/5 1-2 days Newbie friendliness 58/100
haskell/containers#1251 ·
Maintainers usually reply within 2 days
-
maintainability major-release
Difficulty 3/5 1-2 days Newbie friendliness 70/100
haskell/containers#1250 ·
Maintainers usually reply within 2 days
-
performance Tree
Difficulty 3/5 1-2 days Newbie friendliness 55/100
haskell/containers#1247 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
haskell/containers#1242 ·
Maintainers usually reply within 2 days
-
performance
Difficulty 5/5 Over a week Newbie friendliness 35/100
haskell/containers#1220 · 3 comments ·
Maintainers usually reply within 2 days
All issues in haskell/containers
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
digitallyinduced/ihp#2832 ·
Maintainers usually reply within 1 day
-
Preserve bind arrowOpen
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
alunduil/siren-json.hs#233 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
alunduil/network-arbitrary#180 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100