jfmengels/elm-review-simplify

Removes thunk in decoder, causes infinite loop

Open

#318 opened on Aug 24, 2024

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Elm (10 forks)github user discovery
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.

Contributor guide