Re: [elm-discuss] Stance on native APIs for 0.18?

2016-12-16 Thread Desmond D'Souza
Sorry to be dense, but ... in what actual scenario would the following cause problems, assuming I am writing for the browser? - Allow Elm code to make synchronous function calls to js, expecting a js value wrapped in a Result - Use encoders / decoders if needed at the boundary, a dec

Re: [elm-discuss] Re: Stance on native APIs for 0.18?

2016-12-14 Thread Desmond D'Souza
On Wednesday, December 14, 2016 at 1:30:48 PM UTC-6, Rupert Smith wrote: > > On Wednesday, December 14, 2016 at 6:00:14 PM UTC, Desmond D'Souza wrote: >> >> I would love to be able to make synchronous functional calls to js and >> get a Result back. >> > &g

Re: [elm-discuss] Re: Stance on native APIs for 0.18?

2016-12-14 Thread Desmond D'Souza
be the right way to do all *intentional* side effects or communication. But calling some js loaded in the browser right alongside my Elm code to synchronously compute *layout(graph) *should be handled as similarly as possible to doing all the computation in Elm itself. > > On Wed, Dec 1

Re: [elm-discuss] Re: Stance on native APIs for 0.18?

2016-12-14 Thread Desmond D'Souza
I would love to be able to make synchronous functional calls to js and get a Result back. Taking simple clean synchronous functional code (e.g. if it were all in Elm), and being forced to chop out bits into async calls with async Msg callbacks (just because it is not all in Elm) impacts my cod

Re: [elm-discuss] Re: [elm-dev] Re: 0.17 Tasks vs Cmds

2016-12-13 Thread Desmond D'Souza
On Monday, December 12, 2016 at 11:56:19 PM UTC-6, Janis Voigtländer wrote: > > Okay, so I think that your implementation strategy is viable and addresses > the use cases that the earlier tick batching trick addressed. One could do > this as you propose with tasks, handling the “what about chaine

[elm-discuss] Re: What's the best way to chain updates?

2016-12-04 Thread Desmond D'Souza
There is a more detailed explanation here and here and here . On Friday, December 2, 2016 at 10:56:37

[elm-discuss] Re: Checkbox example

2016-11-16 Thread Desmond D'Souza
Try feeding the model property through to *view* : view : Model -> Html Msg view model = fieldset [] [ checkbox model.notifications ToggleNotifications "Email Notifications" , checkbox model.autoplay ToggleAutoplay "Video Autoplay" , checkbox model.location ToggleLocation "Use Locati

[elm-discuss] Re: Checkbox example

2016-11-16 Thread Desmond D'Souza
Try changing *update *to this: { model | notifications = True } -- instead of { model | notifications = not model.notifications } Stateful elements, including checkboxes, seem to ignore what Elm tells them, and simply use their own internal current state. Not sure what virtual dom is (or shou