elm-community / parser-combinators

A parser combinator library for Elm.
http://package.elm-lang.org/packages/elm-community/parser-combinators/latest
BSD 3-Clause "New" or "Revised" License
104 stars 13 forks source link

"Uncaught TypeError: Cannot read property 'ctor' of undefined" when using Combine.parens #14

Closed Dobiasd closed 8 years ago

Dobiasd commented 8 years ago

Hi,

this minimal example produces that error. Here is my elm-package.json

Is this a bug, or is the error on my side? If I set

stringToParse = "a"

everything works fine.

Bogdanp commented 8 years ago

Hi!

The issue is you are eagerly calling dataParser in its body.

Check out http://package.elm-lang.org/packages/Bogdanp/elm-combine/2.2.1/Combine#rec and https://github.com/Bogdanp/elm-combine/issues/7#issuecomment-177468446 for a more in-depth explanation.

Dobiasd commented 8 years ago

Argh, no lazyness, of course. Thank you very much, and sorry for bothering.