[elm-discuss] Re: Design question: using Dict, List with index, or Array (or something I'm not aware of)

2016-08-16 Thread Wouter In t Velt
Touche, I had an omission in my snippet also :) The getItem should have been: getItem : List Item -> ID -> Maybe Item getItem : list id = List.filter (\item -> item.id == id) list |> List.head To turn the (maybe empty) list of with the item-to-get into a Maybe Item. I did use a lot of Dict

[elm-discuss] Re: Design question: using Dict, List with index, or Array (or something I'm not aware of)

2016-08-13 Thread Ian Mackenzie
My initial reaction is also #3. I think it's totally sensible to do a bit of transformation when serializing/deserializing, and more important to optimize your model for its use in view and update. On Friday, 12 August 2016 23:03:34 UTC+10, Robert Walter wrote: > > Hello, > > following