elm / parser

A parsing library, focused on simplicity and great error messages
https://package.elm-lang.org/packages/elm/parser/latest
BSD 3-Clause "New" or "Revised" License
228 stars 46 forks source link

lazy doesn't work with always instead of (\_ -> ..) #50

Open mathiajusth opened 3 years ago

mathiajusth commented 3 years ago

Hello, I have ran across this

This works:

parser : Parser ()
parser =
    Parser.lazy (\_ -> parser)

But this

parser : Parser ()
parser =
    Parser.lazy (always parser)

throws error Thexvalue is defined directly in terms of itself, causing an infinite loop. image

I guess it would be enought to add a Hint about it so that if someone runs linto this he doesn't have to debug it.