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 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