jfmengels/elm-review-simplify
View on GitHubRemoves thunk in decoder, causes infinite loop
Open
#318 opened on Aug 24, 2024
bughelp wanted
Repository metrics
- Stars
- (22 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Hello! I've found a corner case when simplifying decoders.
The above simplification looks fine at first glance. The problem is that it actually changes the meaning of the code. There's a reason this decoder was written this way, using a thunk: this snippet of code lives inside the compose function, and after simplification, it will cause the function to recursively call itself in an infinite loop.