Re: [elm-discuss] Weird bug where messages passed to the wrong 'component'

2016-12-13 Thread Simon
Thanks, I suspected that keyed would be part of the solution. Any sense on whether I need to apply it only to the components being left (easy) with no need on those that the code is switching to (much leasy in my case)? On Wednesday, 14 December 2016 03:55:29 UTC+1, Mark Hamburg wrote: > > I ju

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

2016-12-13 Thread Mark Hamburg
I basically look on it as code that exists to make Elm run at all. That's basically what Native exists for. (Native also plays games with the type system but that's another matter.) And then there's external code that I would like to run that isn't critical to Elm being Elm. That seems a natural p

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

2016-12-13 Thread Mark Hamburg
Then people would complain that all native calls returned Results rather than the type they wanted returned. Mark On Tue, Dec 13, 2016 at 7:42 AM, Joey Eremondi wrote: > the elm package repo would very quickly get poluted with js code that >> causes runtime exceptions > > > But, Tasks have erro

Re: [elm-discuss] Weird bug where messages passed to the wrong 'component'

2016-12-13 Thread Mark Hamburg
I just dug into what I think is essentially the same bug. My guess was that textfields were getting removed from the DOM and then firing their blur events up through the event mapping chain — which had been updated to match the new view tree structure. It's on my list to try to build a small exa

[elm-discuss] Re: onClick while shift key pressed

2016-12-13 Thread Marshall handheld Flax
Thank you so much! Will try tomorrow! Marshall On Tuesday, December 13, 2016 at 10:09:29 AM UTC-5, Wouter In t Velt wrote: > > Here's how I would do it: > > onShiftClick : msg -> Attribute msg > onShiftClick message = > let > hasShift shiftKey = > if shiftKey then >

Re: [elm-discuss] “TypeError: domNode is undefined” and other errors with Elm and 3rd party JS libraries

2016-12-13 Thread Nick H
I think the way to work cleanly with a DOM-rewriting library is to decide which parts of your page you want Elm to control and which parts you want JS to control. You can use Elm.Main.embed to restrict your Elm program to only controlling a part of the page. Or you could use Platform.program to ru

[elm-discuss] Re: Patterns for sum and product types

2016-12-13 Thread Wouter In t Velt
Great resources Rafal! Thanks for sharing! -- 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

[elm-discuss] Re: Patterns for sum and product types

2016-12-13 Thread Wouter In t Velt
Those are great posts Rafael! Thanks for sharing. -- 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, visi

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] Weird bug where messages passed to the wrong 'component'

2016-12-13 Thread Simon
Sorry about using the C word! I had an error several months ago (0.16/0.17) where the wrong data would be attached to message, causing all sorts of weirdness. It happened after a successful logon and as the App tried to redirect to the main view. I have a vague feeling that in the end all I nee

[elm-discuss] Re: Design concepts. Too many Msg's?

2016-12-13 Thread Rex van der Spuy
One of the things I like most about Elm is how programs are organized around messages. You can almost read them like a table of contents to your program, or like book chapters. They act as a high-level map to your program, so the more the merrier :) -- You received this message because you are

Re: [elm-discuss] Why latest versions of elm-compiler not available on Hackage?

2016-12-13 Thread Joey Eremondi
Hmm, for something like that, you're probably best to just copy the Elm-compiler from Github. Perhaps you could include it in your project as a git submodule, so that you can update it as Elm updates it? In any case, it's unlikely an API would be exported before Elm hits 1.0, so that anyone using

[elm-discuss] Re: Patterns for sum and product types

2016-12-13 Thread Rafał Cieślak
I'd love to see those "patterns" written down, too! For now, other than Richard Feldman's talk "Making Impossible States Impossible", I have only found two F# resources: * The "Designing with types" series on F# for fun and profit https://fsharpforfunandprofit.com/series/designing-with-types.ht

Re: [elm-discuss] Why latest versions of elm-compiler not available on Hackage?

2016-12-13 Thread Jan Hrček
Joey, thanks for the answer. About my use case: I would like to implement some tool in haskell to visualize various aspects of elm packages as graphs (as I am quite crazy about using graphs to understand software). For example 1) package dependencies: nodes = packages; edge from X to Y meaning

[elm-discuss] Re: Patterns for sum and product types

2016-12-13 Thread Wouter In t Velt
Op zondag 11 december 2016 20:01:09 UTC+1 schreef Brian Marick: > > Since FP has been around for a long time, too, I’m hoping that those > idioms and patterns have been written down, with a good effort toward > explaining them (with examples!) Where? > As it happens, I just wrote a post on this

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

2016-12-13 Thread Joey Eremondi
> > the elm package repo would very quickly get poluted with js code that > causes runtime exceptions But, Tasks have error handling built into them. We could do something similar with synchronous code, just catch any exceptions thrown, and treat the value in Elm as something like a Result. --

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

2016-12-13 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, December 13, 2016 at 4:19:31 AM UTC, Mark Hamburg wrote: > > One doesn't need them to be asynchronous but making them asynchronous > helps reinforce the notion that this is happening outside the Elm universe. > And if you want monads, Elm's tasks are monadic. > I really want to disag

[elm-discuss] Re: Design concepts. Too many Msg's?

2016-12-13 Thread Wouter In t Velt
Op dinsdag 13 december 2016 15:28:50 UTC+1 schreef Manu Rosa: > > ...I am curious as to what's the (communitie's) best practice to tackle > this. > Hi Manu, One of the bigger examples (and my favorite) out there is the Time Tracker app: https://github.com/knewter/time-tracker They use nested mes

[elm-discuss] Re: onClick while shift key pressed

2016-12-13 Thread Wouter In t Velt
Here's how I would do it: onShiftClick : msg -> Attribute msg onShiftClick message = let hasShift shiftKey = if shiftKey then JD.succeed message else JD.fail "No shift key" in on "click" <| JD.andThen hasSh

[elm-discuss] Design concepts. Too many Msg's?

2016-12-13 Thread Manu Rosa
Hello, I am fairly neew to elm, and we've started using it in my team for a simple Web application, successfully so far, which I'm very happy about. I just wanted to ask you about a concern that I've been having is a growing list of Msg values in the update function. This concerns me more and mo

[elm-discuss] Elm-make freezes !

2016-12-13 Thread Sébastien FLOURE
frozen at 92/156 ! Any log available ? any idea how to fix that ? Thanks -- You received this message because you are subscribed to the Google Groups "Elm Discuss