Re: [elm-discuss] Re: Record update syntax

2016-08-15 Thread Aaron VonderHaar
Can you give more details about an example of where doing nested record updates is useful? When I've run into nested records in real projects, usually it's a better choice to remove the nested update. Here are two ways to do that: 1) flatten the record This is appropriate when a single module

Re: [elm-discuss] Re: Record update syntax

2016-08-14 Thread OvermindDL1
Lists/Dicts/Records do have different interfaces, however if Elm had HKT's it would not need to, you could have a generic 'map' function that works over all of them, a generic fold, etc... and so forth (See Haskell). However note the List Access is what would define the required structure of

Re: [elm-discuss] Re: Record update syntax

2016-08-14 Thread Joey Eremondi
Also, Lists, Dicts, and Records have different interfaces *because they are fundamentally different* If you are accessing the nth element of a List so often that you need special syntax to do so, you are doing something wrong, because list's are intended for iteration. You probably want an array.

Re: [elm-discuss] Re: Record update syntax

2016-08-14 Thread Joey Eremondi
@OvermindDL1: I'm still grokking what you've proposed, but it's problematic for a few reasons. I'm 99% sure that it can't be done in a way that is type safe. What you're doing doesn't need Higher-Kinded types, it's just not type safe, at least not as how it's presented here. One is that you've

[elm-discuss] Re: Record update syntax

2016-08-14 Thread OvermindDL1
Expressions are not currently allowed to be updated like that, so would that return a model with the something.more updated on it (seems surprising) or return model.something with more updated on it (not surprising, and would allow arbitrary expressions there). On Saturday, August 13, 2016 at

[elm-discuss] Re: Record update syntax

2016-08-13 Thread Robin Heggelund Hansen
All I really want is: ```elm { model.something | more = 42 } ``` søndag 14. august 2016 02.49.07 UTC+2 skrev OvermindDL1 følgende: > > Just a passing idea to perhaps help give ideas for better methods: > > > Updating a nested record is a bit convoluted as something like: > ```elm > let >