On Wednesday, November 30, 2016 at 4:58:31 PM UTC, Richard Feldman wrote: > > Even more, it is exactly like described here >> https://gist.github.com/evancz/2b2ba366cae1887fe621 >> <https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fevancz%2F2b2ba366cae1887fe621&sa=D&sntz=1&usg=AFQjCNGa0I93bqfcXgbvsL9nfTsQK8GW7A> >> by >> the author of Elm >> > This is a gem. Not seen it before but there are some really useful ideas >> in there. >> It had not occurred to me that we can create record types with a 'hole' >> in them, which can then be used to compose them together to build larger >> records, but at the same time we can write functions that just operate on >> whatever components of the record we choose as the level of abstraction to >> re-use. I'm talking about the "Reusable Actions" section. > > > Yikes, definitely don't do that! That link is from Elm 0.13 - back when > everything was based around Signals, the Elm Architecture did not exist > yet, and Evan was still trying out different approaches to figure out what > worked best. >
Tried it and it seems to work ok in 0.18. Only thing was the need to add the 'alias' keyword to the record definitions. Its not a solution I would reach for quickly, but decomposing record types and functions over them in this way does seem entirely permissable within the language. -- 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.
