On Monday, November 27, 2017 at 7:50:01 AM UTC, Mark Hamburg wrote:
>
> P.S. Cyclic structures can be avoided by having the compiler perform a 
> strongly connected component analysis (e.g., using Tarjan's algorithm) and 
> disallowing any SCC's that include anything other than function 
> definitions. In fact, not doing so likely leaves open other cyclic cases 
> and hence getting rid of Lazy likely does not eliminate cycles and instead 
> just narrows the cases for which Elm is suitable.
>

My hunch is that enough has been done to make cyclic structures impossible, 
but I have made no detailed analysis to support that. If all data 
structures are immutable, then references within them have to be created 
when the structure is first created. The first structure in a cycle to be 
created must contain a reference to another structure in the cycle, for a 
cycle to be formed, but as the other structures have not yet been created, 
this cannot be done.

I think you should post an example of building a cyclic structure here, if 
you think it can be done:

https://gist.github.com/evancz/07436448b7d6c947f21742dab46d1218 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to