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 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 
> example of the bug after my team gets through its next milestone.
>
> In the meantime, I worked around this by making fairly aggressive use of 
> Html.Keyed to prevent pieces of the DOM from being reused.
>
> Mark
>
> On Dec 13, 2016, at 9:56 AM, Simon  
> wrote:
>
> 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 needed to do was update 
> elm-lang/virtual-dom.
>
> Anyway, it has come back. It has something to do with when the browser 
> puts in login information for you. I can create the error by deleting the 
> auto-input and inserting my password and clicking enter to submit.
>
> Then what I see in my logs is this message
>
> `User.SwitchGroup: Blur "password"`
>
> Whereas SwitchGroup has type `String -> Msg` and `Blur "password"` are 
> artefacts of the elm-form library that was used in the Login component and 
> is not used in the User one.
>
> Does this remind anyone of something they have experienced, solved, and 
> remembered how they solved it?
>
> -- 
> 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...@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.


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 place to deploy Tasks.

Mark

On Tue, Dec 13, 2016 at 8:06 PM, Mark Hamburg  wrote:

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


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


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 example of the bug 
after my team gets through its next milestone.

In the meantime, I worked around this by making fairly aggressive use of 
Html.Keyed to prevent pieces of the DOM from being reused.

Mark

> On Dec 13, 2016, at 9:56 AM, Simon  wrote:
> 
> 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 needed to do was update 
> elm-lang/virtual-dom.
> 
> Anyway, it has come back. It has something to do with when the browser puts 
> in login information for you. I can create the error by deleting the 
> auto-input and inserting my password and clicking enter to submit.
> 
> Then what I see in my logs is this message
> 
> `User.SwitchGroup: Blur "password"`
> 
> Whereas SwitchGroup has type `String -> Msg` and `Blur "password"` are 
> artefacts of the elm-form library that was used in the Login component and is 
> not used in the User one.
> 
> Does this remind anyone of something they have experienced, solved, and 
> remembered how they solved it?
> 
> -- 
> 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: 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
> JD.succeed message
> else
> JD.fail "No shift key"
> in
> on "click" <|
> JD.andThen hasShift <|
> JD.at [ "shiftKey" ] JD.bool
>
> More or less adapted from the TodoMVC app (which Json-fails on any other 
> keycode than 13)
>
> Working example on: https://runelm.io/c/6mf
>

-- 
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] “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 run Elm
headlessly, with no view at all. Either way, you can use ports to
communicate with external JavaScript, which can in turn control the non-Elm
DOM.

There has also been some talk on the list about Polymer and Web
Components... maybe you can find a more satisfactory solution with those
tools. But I don't know anything about that.

On Mon, Dec 12, 2016 at 3:19 PM,  wrote:

> I posted this over on Stack Overflow
> ,
> but thought I would ask here too.
>
> I have been trying to use Elm applications to work with a handful of "UI
> Widget" type libraries. In particular I have been working with highlight.js
> and CodeMirror.
>
> This  is a set of
> pared down code snippets from the project. The "Simple" example is just the
> raw elm app with no 3rd party libraries to show the expected result of the
> application. "Highligh JS" is a version showing errors working with the
> highlight.js library. Finally "CodeMirror" shows issues working with the
> CodeMirror library.
>
> The source code for the above examples can be found here
> . The pertinent files are
> /src/*.elm and docs/*.html
>
> The CodeMirror example gives the error from the title while the Highlight
> JS example results in a "corrupted" DOM.
>
> Many 3rd party JS libraries modify the DOM. How do you work with those
> libraries cleanly in Elm?
>
> --
> 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: 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://groups.google.com/d/optout.


[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 needed to do was update 
elm-lang/virtual-dom.

Anyway, it has come back. It has something to do with when the browser puts 
in login information for you. I can create the error by deleting the 
auto-input and inserting my password and clicking enter to submit.

Then what I see in my logs is this message

`User.SwitchGroup: Blur "password"`

Whereas SwitchGroup has type `String -> Msg` and `Blur "password"` are 
artefacts of the elm-form library that was used in the Login component and 
is not used in the User one.

Does this remind anyone of something they have experienced, solved, and 
remembered how they solved it?

-- 
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: 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 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] 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 the parser is aware of the instability of the language.

On Tue, Dec 13, 2016 at 9:29 AM, Jan Hrček  wrote:

> 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 X
> declares dependency on Y
> 2) module dependencies: nodes = modules from given package; edge from X to
> Y meaning module X imports module Y
> 3) implementation dependencies inside a module: nodes = top-level
> functions in the module; edge from X to Y means function declaration X uses
> Y on its right side
>
> It would be nice to have some Haskell library available to get access to
> elm ASTs (even better in some canonical form - when package/module data are
> available for every function in the source code).
>
>
> On Friday, December 9, 2016 at 5:17:40 PM UTC+1, Joey Eremondi wrote:
>>
>> Jan, can you tell us about your use case?
>>
>> Elm-compiler doesn't export the parser as a library. If you're looking to
>> do stuff like that, elm-format might be a better starting point for a
>> parser: https://github.com/avh4/elm-format
>>
>> The syntax is not exported as an API because it is subject to change: Elm
>> is currently pre-1.0, and as you can see from our release notes, the syntax
>> frequently changes between releases.
>>
>> Additionally, many people who use Elm are not Haskell users, so we didn't
>> want them to need Haskell in order to use Elm, thus the switch to NPM
>> and/or the Windows/Mac installers.
>>
>> On Fri, Dec 9, 2016 at 8:10 AM, Nick H  wrote:
>>
>>> You need to build from source.
>>>
>>> The elm compiler moved from hackage to npm. It was never maintained in
>>> both places at once.
>>>
>>> On Fri, Dec 9, 2016 at 1:51 AM, Jan Hrček  wrote:
>>>
 Hello,

 is there a distribution of latest (0.18) elm-compiler available as
 haskell library? I checked hackage
  but that only has
 version 0.15. Or do I need to build it from sources?
 I'd like to make use of the elm parsing capabilities of the library to
 use in my project..
 Or is there some reason why Evan is no longer publishing latest
 versions of the package on hackage?

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

-- 
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: 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.html
* Types + Properties = Software by Mark 
Seemann http://blog.ploeh.dk/2016/02/10/types-properties-software/

I really liked Mark's series, because it shows a specific example that is 
solved in an elegant way – something that I wish to be able to do on my own.
Basically I followed his steps, but instead of implementing the kata in F#, 
I did it in Elm – it was a very fun experience!
I posted a short summary of it on my blog 
– 
http://mirrors.link/posts/the-polyglot-approach-to-modeling-state-and-property-tests-in-elm

On Sunday, December 11, 2016 at 8:01:09 PM UTC+1, Brian Marick wrote:
>
> I’m repeatedly finding myself running into decisions about sum and product 
> types where I’m choosing among alternatives like these: 
>
> > type FormValue valueType explanationType 
> >   = Valid valueType 
> >   | Invalid valueType explanationType 
> >   | Unchecked valueType 
> > 
> > -- vs 
> > 
> > type ValidationStatus explanationType 
> >   = Valid 
> >   | Invalid explanationType 
> >   | Unchecked 
> > 
> > type alias FormValue2 valueType explanationType = 
> >   { value : valueType 
> >   , status : ValidationStatus 
> >   } 
> > 
> > -- vs 
> > 
> > -- Something better that makes invalid states 
> > -- impossible. 
>
> Too often, I realize the drawbacks of a decision way later than I’d like. 
>
> Because I was hanging around with OO people in the early 80s, I recognize 
> this kind of floundering. Idioms and patterns that we find obvious today 
> were the subject of much discussion, experimentation, and - finally - 
> widespread diffusion. (Though design patterns sort of took a wrong turn, 
> and are now out of favor, their original goal of documenting and explaining 
> the “why” behind certain common solutions was really powerful.) 
>
> 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? 
>
> (What I’ve seen has been focused more on laws and provability, as opposed 
> to the OO emphasis on Simon’s “satisficing” [*]. Plus, the rather banal 
> observation that many OO patterns are unneeded or built in to FP languages 
> led to some strong claims (around 2000, especially) that FP systems don’t 
> have any design patterns - and I’m afraid the hangover from that has kept 
> people from writing the sort of example-based guidelines I’m looking for. 
> Hope I’m wrong.) 
>
>
> [*] Satisficing is the process of looking for good-enough solutions rather 
> than continuing on in hopes of finding an optimal one. 
> https://en.wikipedia.org/wiki/Satisficing 
>
>
>

-- 
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] 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 X 
declares dependency on Y
2) module dependencies: nodes = modules from given package; edge from X to 
Y meaning module X imports module Y
3) implementation dependencies inside a module: nodes = top-level functions 
in the module; edge from X to Y means function declaration X uses Y on its 
right side

It would be nice to have some Haskell library available to get access to 
elm ASTs (even better in some canonical form - when package/module data are 
available for every function in the source code).


On Friday, December 9, 2016 at 5:17:40 PM UTC+1, Joey Eremondi wrote:
>
> Jan, can you tell us about your use case?
>
> Elm-compiler doesn't export the parser as a library. If you're looking to 
> do stuff like that, elm-format might be a better starting point for a 
> parser: https://github.com/avh4/elm-format
>
> The syntax is not exported as an API because it is subject to change: Elm 
> is currently pre-1.0, and as you can see from our release notes, the syntax 
> frequently changes between releases.
>
> Additionally, many people who use Elm are not Haskell users, so we didn't 
> want them to need Haskell in order to use Elm, thus the switch to NPM 
> and/or the Windows/Mac installers.
>
> On Fri, Dec 9, 2016 at 8:10 AM, Nick H  > wrote:
>
>> You need to build from source.
>>
>> The elm compiler moved from hackage to npm. It was never maintained in 
>> both places at once.
>>
>> On Fri, Dec 9, 2016 at 1:51 AM, Jan Hrček > > wrote:
>>
>>> Hello,
>>>
>>> is there a distribution of latest (0.18) elm-compiler available as 
>>> haskell library? I checked hackage 
>>>  but that only has 
>>> version 0.15. Or do I need to build it from sources?
>>> I'd like to make use of the elm parsing capabilities of the library to 
>>> use in my project..
>>> Or is there some reason why Evan is no longer publishing latest versions 
>>> of the package on hackage?
>>>
>>> -- 
>>> 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...@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...@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: 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 topic over on Medium: 
https://medium.com/@wintvelt/how-to-make-impossible-states-impossible-c12a07e907b5

It is more of an experiment with different directions. It would be 
interesting if there were more extensive patterns around from people with 
more of an FP background..

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

-- 
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: 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 disagree with you because it makes it a PITA when you just 
want to call a pure function written in js, but I have to concede that you 
are right. If making simple synchronous calls to javascript was the 
supported mechanism for interfacing, the elm package repo would very 
quickly get poluted with js code that causes runtime exceptions and it not 
portable. 

Another advantage is that it encourages people to write pure functions in 
Elm in order to share their work, and we all benefit from that.

Best thing to tell people looking for 'unsafe' modules in Elm then, is to 
tell them that we already have them it is just that the keyword is 
'native', and that the platform is protected from such unsafe code by not 
officially supporting it.

-- 
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: 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 messages.
You may want to check that out.. 

-- 
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: 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 hasShift <|
JD.at [ "shiftKey" ] JD.bool

More or less adapted from the TodoMVC app (which Json-fails on any other 
keycode than 13)

Working example on: https://runelm.io/c/6mf

-- 
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] 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 more 
as the application grows and I am curious as to what's the (communitie's) 
best practice to tackle this.
I reckon this might be a trivial question for most, but I haven't found 
anything similar in the documentation as examples tend to focus on single 
purpose (simple) applications, which makes a lot of sense.

Thanks a lot in advance, I look forward to continue learning, using and 
finding joy in Elm!

Manu

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