Re: [elm-discuss] Re: Module manipulation

2016-09-13 Thread OvermindDL1
On Tuesday, September 13, 2016 at 8:43:27 AM UTC-6, Joey Eremondi wrote:
>
> It's also worth mentioning that first class modules are a decent 
> replacement for type classes.
>

That is precisely the main reason that I am wanting them.  ^.^

Although in that case having OCaml'ish Class Interfaces[0] would simplify 
code even further.  ^.^


[0]: http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual005.html#toc24

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


Re: [elm-discuss] Re: Module manipulation

2016-09-13 Thread Joey Eremondi
It's also worth mentioning that first class modules are a decent
replacement for type classes.

On Sep 13, 2016 7:28 AM, "OvermindDL1"  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 elm-discuss+unsubscr...@googlegroups.com.
> 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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: Module manipulation

2016-09-13 Thread OvermindDL1
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.