I would still like to find a good way to structure messages.  I'm up to 146 
in the base Msg type, and it is not flat, by counting it seems that I have 
6 message types that just hold another message type for something further 
down, which average in size from 2 for 1 of them, 4 for 3 of them, 8 for 1, 
and 21 for another (and that 21 is growing as well).  I kind of namespace 
the message type by following a naming convention of 
`<SectionCamelCase>_<SpecificMsgCamelCase>`, like this set at the top for 
example:
```
    | RoomList_Init Int (List RoomDef)
    | RoomList_Joined Int (List RoomDef)
    | RoomList_Parted Int (List RoomDef)
    | RoomList_Notif Int (List MsgObj)
```

It works, but does not feel right, like I feel the whole Room handling 
stuff should be delegated out too, but that just ends up going further out 
of 'flat' messages that everyone keeps saying to do here, but I really feel 
like that is the wrong way and about to swap all this to a tree of messages 
as the couple that are like that work really well...  >.>


On Thursday, September 22, 2016 at 3:17:23 PM UTC-6, Charlie Koster wrote:
>
> As far as Msgs go, why not just flatten it since it's, as you say, a 
> simple app?
>
> type Msg 
>     = NoOp 
>     | Component1Msg 
>     | Component2Msg
>
> We decided to go down that route on our project and we currently have 10 
> Msgs, and it will likely grow to be a few dozen. Unless there's a really 
> good reason to refactor it, we'll keep growing that flattened list.
>
> In regard to the rest of the app architecture and organization, we're 
> experimenting with that as well and we think we have a good implementation 
> going. I'm actually planning on publishing the decisions we made with our 
> app as well as our repository with its git history so people can look at 
> the history of how our app came to be.
>
> Unfortunately, we're still 6-8 weeks away from getting it to a 
> publish-able state so sorry that it's not much help right now.
>

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