elm / parser

A parsing library, focused on simplicity and great error messages

Home Page:https://package.elm-lang.org/packages/elm/parser/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

mathiajusth opened this issue · comments

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 The x value 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.