Re: [elm-discuss] Mutually dependent types

2017-01-13 Thread Wouter In t Velt
Op vrijdag 13 januari 2017 09:13:25 UTC+1 schreef Marco Perone: > > Coming back to my original question, supposing we have two mutually > recursive types, they must be in the same module and hence in the same > file, right? > Yes, that is what I would think too. I would argue that it would be

Re: [elm-discuss] Mutually dependent types

2017-01-13 Thread Marco Perone
This is exactly what I am doing right now to circumvent this issue. But I feel that this is some kind of language limitation that I would like to avoid. It would be nice to be able to define parts of the same module in different files 2017-01-13 17:17 GMT+01:00 Wouter In t Velt

Re: [elm-discuss] Mutually dependent types

2017-01-04 Thread Wouter In t Velt
Somewhat late, but there is a nice exposition on this by Evan over here: https://github.com/elm-lang/elm-compiler/blob/master/hints/recursive-alias.md -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop

Re: [elm-discuss] Mutually dependent types

2016-12-30 Thread Joey Eremondi
You need to use type, not type alias, for mutual recursion. Type aliases are just ways to give a type a new name, and are expanded in the compiler, which would not terminate if recursion was allowed. On Dec 30, 2016 7:39 AM, "Marco Perone" wrote: You're right! Sorry for the

Re: [elm-discuss] Mutually dependent types

2016-12-30 Thread Cristian Garcia
Is it even posible to have such a type in the Elm type system? I dont think you can call this type recursive, it looks like an infinite type. On Fri, Dec 30, 2016, 03:29 Marco Perone wrote: > I have two types > > type alias Player = > { ... > , team :

[elm-discuss] Mutually dependent types

2016-12-30 Thread Marco Perone
I have two types type alias Player = { ... , team : Team } type alias Team = { ... , players : List Players } which clearly have a circular dependency. I am duplicating data and I am doing that on purpose. Now the question is: is it