It's also worth mentioning that first class modules are a decent replacement for type classes.
On Sep 13, 2016 7:28 AM, "OvermindDL1" <[email protected]> wrote: > It seems you are wanting something like OCaml has, first-class modules > that can be passed around like types and data like OCaml does it? > > I would love that and it would fix a lot of the verbosity I have. > > > On Tuesday, September 13, 2016 at 1:23:55 AM UTC-6, Charles-Edouard Cady > wrote: >> >> Would anybody besides me be interested in being able to manipulate module? >> I was thinking something on the lines of: >> >> getUpdate : m -> (m.Model -> m.Msg -> m.Model) >> getUpdate module = >> module.update >> >> Then if you have a module, say >> >> module Counter exposing (update, Msg, Model) >> >> type Model = Int >> >> type Msg = Increment | Decrement >> >> update : Model -> Msg -> Model >> update model msg = >> case msg of >> Increment -> >> model + 1 >> Decrement -> >> model - 1 >> >> you could use >> >> update = getUpdate Counter >> >> I think it would allow meta module operations such as putting a list of >> modules in a view or a list of updates in one big SPA update. >> >> What do you think? >> > -- > 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. > -- 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.
