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 <[email protected]>:

> 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 nice to have the possibility to define
>> mutually recursive type in different files at least, if not in different
>> modules. What do you think?
>>
>
> I think this is impossible, because you would always get circular imports:
> each module needs import the type from the other module.
>
> If you don't have mutually recursive types, (like one of your earlier
> responses suggest), but only reference with IDs, like:
>
> type alias Team =
>   { name : String
>   , playerIDs : List String
>   , id : String
>   }
>
> type alias Player =
>   { name : String
>   , teamID : String
>   , id : String
>   }
>
>
> Then you can put Team and Player in different modules.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/elm-discuss/si6DOd-rol8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Marco Perone

@marcoshuttle <https://twitter.com/marcoshuttle>
https://github.com/marcosh
http://marcosh.github.io/

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to