Open oliver-batchelor opened 7 years ago
This alone won't help as we can probably also have mutual recursion. So to fix this we have to add a _
-function to all object decoders and always use that instead, or build in recursion detection which I want to avoid.
Other thoughts? cc @bartavelle
Also: Are you up for doing a PR @Saulzar ? :)
Would it work if we change the Dict to be a dict of functions () -> Decoder a
?
Happy to figure out a PR if the solution works :)
@agrafix no other thoughts, except that this helper exists.
Ah, lazy sounds good!
Seems to work well for me right now, any update?
I wrote quite a lot of IsElmDefinition
definitions manually, because this library does not have an option to generate types that are not type aliases, and because I had to define and adapt special dummy types in Haskell for Elm, which cannot handle recursive data types in type aliases. I have written quite a lot of IsElmDefinition
definitions manually.
I'm considering modifying it for pull requests because I think it might be better to be able to define types that are not type alias, but is there any commitment to type alias?
Hi there - there's an issue creating Elm decoders for recursive types, apparently Elm cannot handle recursive values due to it's strictness.
jsonDecEdit
is defined directly in terms of itself, causing an infinite loop.Maybe the solution is to give it a dummy argument to a helper function? e.g.