[elm-discuss] Re: Subscribe to a model value then call update function when condition is met

2016-10-11 Thread hoangtkc95
I'm sorry. Don't why your answer wasn't loaded that day. Aren't "set and unset whenever processing is started/finished" side-effects? We can do that easily in imperative languages but all functions in ELM are pure. Vào 03:55:33 UTC+7 Thứ Ba, ngày 11 tháng 10 năm 2016, OvermindDL1 đã viết: > >

[elm-discuss] Re: Subscribe to a model value then call update function when condition is met

2016-10-11 Thread hoangtkc95
But if I do it this way, it's gonna return both the player's move and the AI's move at the same time. What I want to have is that the game displays the player's move THEN call minimax function on current model and THEN display the AI's move Vào 06:41:14 UTC+7 Thứ Tư, ngày 12 tháng 10 năm 2016,

[elm-discuss] Re: Subscribe to a model value then call update function when condition is met

2016-10-11 Thread Luke Westby
It's a common misunderstanding that every discrete change to a model must originate from a different message. In general messages are for expressing what is allowed to happen in your application as a result of outside behavior like user input and server responses, whereas you want to run your

[elm-discuss] Re: Pure Elm contenteditable rich text editor

2016-10-11 Thread Luke Westby
Everything you need to do this should be available with the notable exception of the Selection API (https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection), which would allow you to manipulate the cursor and selected text programatically. -- You received this message because

[elm-discuss] Re: Another documentation item I think is needed

2016-10-11 Thread J. E. Marca
Thanks for the reply... On Tuesday, October 11, 2016 at 4:36:47 AM UTC-7, Wouter In t Velt wrote: > > The comparison page you refer to is more a high-level comparison between > javascript and elm syntax. > It does not look like it is intended to be in-depth. > > I agree it would be useful to

Re: [elm-discuss] Pattern matching on aliased types

2016-10-11 Thread Duane Johnson
On Tue, Oct 11, 2016 at 7:36 AM, Ethan Martin wrote: > How does one check against a List containing a certain type? For instance, > I only want to map all elements of a string through the toString function > if that list does not already contain strings. The end result

[elm-discuss] Elm GUI component library

2016-10-11 Thread Casper Bollen
I would love to use ELM as my client side language. However, a show stopper at the moment is the lack of a decent ELM GUI component library. Currently I am using webix an extremely simple to use library to create a complex one page application. I think it would be a great

[elm-discuss] Re: Pure Elm contenteditable rich text editor

2016-10-11 Thread OvermindDL1
This is also what I do for a CMS'ish style of interface in something at work, using elm-markdown to render a real-time view of what is being created. Even pre-markdown back in decades past I still opted two have two panes, one where (at the time) html was put in, and the other showing the

Re: [elm-discuss] Re: Html.Keyed

2016-10-11 Thread OvermindDL1
Eh, not really, it is precisely the same issues as you would have with, for example, React, or any of the other JS libraries that use virtual-doms. Just an aspect of how web browser DOM's are made due to backwards compatibility with a lot of old sites over a period of many many decades. Have

[elm-discuss] Re: Pure Elm contenteditable rich text editor

2016-10-11 Thread 'Rolf Sievers' via Elm Discuss
If your users understand markdown, you could use markdown input and maybe even render a preview. This is what I am doing for a project of mine. (This of course circumvents the problem of writing a rich text editor but might help with your original problem.) Am Montag, 10. Oktober 2016

Re: [elm-discuss] Re: Html.Keyed

2016-10-11 Thread Mark Hamburg
I haven't yet dug into the actual example code, but this response goes straight to the issue of continuity of identity that makes things like web components an interesting problem for a functional virtual DOM. Mark P.S. I prototyped a system a few years ago on Cocoa in which view creation was

Re: [elm-discuss] Re: How important is Html.Lazy to performance?

2016-10-11 Thread OvermindDL1
Specifically the server sent a list of records over websocket one at a time (at times a *lot* of records), those were stored pretty much verbatim in the model. I had a field on the model that was just an Int, started at 0, the view rendered the list of those records (just one part of the

Re: [elm-discuss] Re: How important is Html.Lazy to performance?

2016-10-11 Thread Mark Hamburg
Interesting. I can understand using a sentinel to force re-rendering but I'm curious as to how your model or view was structured such that it could inhibit re-rendering via laziness. Mark > On Oct 11, 2016, at 8:42 AM, OvermindDL1 wrote: > > Personally I've known it to

[elm-discuss] Re: Html.Keyed

2016-10-11 Thread OvermindDL1
The ticked checkbox is because the user ticked it, it is some of the implicit DOM state. When the view changed to remove a checkbox but it still had another one after, since they were not keyed it just did a 'diff' between states. The vdom has no information on any implicit state in the

[elm-discuss] Html.Keyed

2016-10-11 Thread Max Froumentin
Hi there, Today I raised https://github.com/elm-lang/virtual-dom/issues/37 Given there's no consensus on whether it's a bug, I'm bringing the discussion here. The reason why I think it's a bug is that the second time the view function runs it generates a ticked checkbox, although nowhere in

[elm-discuss] Re: How important is Html.Lazy to performance?

2016-10-11 Thread OvermindDL1
Personally I've known it to help very little (keyed is usually more appropriate), but there have been a few times where it saves significant processing, but at those places I ended up setting it up with a 'sentry' value in a model (just an integer) that I incremented every time I wanted that

[elm-discuss] How important is Html.Lazy to performance?

2016-10-11 Thread Mark Hamburg
I was looking back at our first "big" (as in not the tiniest of toys) Elm app and at its tendency to factor the model based on the view hierarchy. This had struck me as a dubious pattern at the time and there is a strong argument voiced by some that one should just stay flat as long as

Re: [elm-discuss] beginner question - updating property on child of model

2016-10-11 Thread Chad Deutmeyer
That worked great, Thanks for the help! -- 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

[elm-discuss] Re: Another documentation item I think is needed

2016-10-11 Thread Wouter In t Velt
The comparison page you refer to is more a high-level comparison between javascript and elm syntax. It does not look like it is intended to be in-depth. I agree it would be useful to have some docs at some time summing up the pros and cons of List vs Array vs Set vs Dict. But I am not sure that

[elm-discuss] Re: Subscribe to a model value then call update function when condition is met

2016-10-11 Thread Wouter In t Velt
PS: The subscription to time is useful if you want some sort of timeout or delay between the user move and the AI move. If you want to do the AI move immediately after the user move (without delay), a pattern with a recursive update call (and without subscription) is probably more suited.

[elm-discuss] Re: list of types is missing from docs page at http://elm-lang.org/docs

2016-10-11 Thread Wouter In t Velt
In the standard docs, there is some explanation of types here . But no exhaustive list. In practice, I found that I did not need to learn any of the standard types. In contrast to any other language I know, Elm's compiler is really helpful

Re: [elm-discuss] Svg.map?

2016-10-11 Thread Jeff Russell
Great, thanks. -- 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

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-11 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 11:01:54 PM UTC+1, Richard Feldman wrote: > > Has anyone gotten anything doing really complicated DOM stuff (in > particular Google Maps comes to mind) working in Elm via web components? > > In theory it would Just Work, but in practice I always wonder... ;) > I

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-11 Thread 'Rupert Smith' via Elm Discuss
On Monday, October 10, 2016 at 10:40:25 PM UTC+1, Peter Damoc wrote: > > Now, the next challenge is to figure a way to declare all this in Elm and > automate as much as possible the process of creating the custom components. > :) > I think rolling these Elm web components by hand should

[elm-discuss] Re: How to insert an object into a list from a form

2016-10-11 Thread Wouter In t Velt
Op dinsdag 11 oktober 2016 09:45:57 UTC+2 schreef Did: > > Thanks for your reply! Is there a better way to do this or this is a > common solution in elm? > Well, this is the best way I can think of :) But seriously, as soon as your app grows, some functions in this setup may become big and

Re: [elm-discuss] beginner question - updating property on child of model

2016-10-11 Thread Duane Johnson
On Mon, Oct 10, 2016 at 9:43 AM, Chad Deutmeyer wrote: > { model | someOtherProperty = item } I think you're looking for this: let c = model.child in { model | child = { c | currentItem = item } } -- You received this message because you are subscribed to the

[elm-discuss] Re: list of types is missing from docs page at http://elm-lang.org/docs

2016-10-11 Thread Nathan Eldridge
Can you provide an example of the code? I am still fairly new myself, but I often find that I get errors when I get a little too loose with my type annotations. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and