[elm-discuss] Setting Focus of form inputs

2016-05-27 Thread Matt Woodyard
Is there a elm based way to set the focus of a node or are ports the way to 
do this still?

matt

-- 
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: Best practice for hover

2016-05-27 Thread John Watson
Excellent.  Thanks very much for all your help.

On 27 May 2016 at 21:44, Alexandre Galays  wrote:
> In that case, you're better of just using the :hover selector in CSS.
>
>
> On Friday, May 27, 2016 at 10:15:22 PM UTC+2, John Watson wrote:
>>
>> Nothing fancy - just basic styling of colour, opacity etc.
>>
>> On Friday, 27 May 2016 20:01:13 UTC+1, VeryThorough wrote:
>>>
>>> What do you want to happen on hover?  If you can give some details, I can
>>> probably tell you how to do it in CSS.
>>>
>>> On Friday, May 27, 2016 at 3:46:06 AM UTC-7, John Watson wrote:

 If I have a bunch of buttons that all need to respond to mouseOver
 'hover' in the same way, what's the best practice for implementing this in
 elm?  I have so far looked at mdgriffith/elm-style-animation.  This seems
 fine although I wondered if using this for such simple behaviour was
 overkill.  As far as I can see I need to keep track of state for each 
 button
 and allocate an id to each.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/-Plv1jSG08o/unsubscribe.
> To unsubscribe from this group and all its topics, 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: Best practice for hover

2016-05-27 Thread Alexandre Galays
In that case, you're better of just using the :hover selector in CSS.

On Friday, May 27, 2016 at 10:15:22 PM UTC+2, John Watson wrote:
>
> Nothing fancy - just basic styling of colour, opacity etc.
>
> On Friday, 27 May 2016 20:01:13 UTC+1, VeryThorough wrote:
>>
>> What do you want to happen on hover?  If you can give some details, I can 
>> probably tell you how to do it in CSS.
>>
>> On Friday, May 27, 2016 at 3:46:06 AM UTC-7, John Watson wrote:
>>>
>>> If I have a bunch of buttons that all need to respond to mouseOver 
>>> 'hover' in the same way, what's the best practice for implementing this in 
>>> elm?  I have so far looked at mdgriffith/elm-style-animation.  This seems 
>>> fine although I wondered if using this for such simple behaviour was 
>>> overkill.  As far as I can see I need to keep track of state for each 
>>> button and allocate an id to each.
>>>
>>

-- 
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-stuff causing troubles after each updates

2016-05-27 Thread TheGryzor123
I'm working on automating the "elm package install" command as part of my 
deployment process.

I noticed that each time there is a new update in the packages it then 
breaks my elm-stuff directory. I have to systematically remove it and 
reinstall all the packages to get my app working again.

Am I the only one having this issue?

-- 
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: Import module from src directory in elm-repl

2016-05-27 Thread Nick H
Three questions:

1. What happens if you run

rm -rf elm-stuff/build-artifacts

And then try elm-repl again?

2. Would you mind sharing your entire elm-package.json?

3. Is 0.17 the only version of Elm you have installed?

I wasn't able to reproduce your problem, so I am just trying to get more
info.


On Fri, May 27, 2016 at 5:20 AM, Shump  wrote:

> My elm-package.json has the following entry:
> ...
> "source-directories": [
> "src"
> ],
> ...
>
> and my directory looks like this (minus elm-stuff folder in the root)
> .
> ├── build
> │   └── MyModule.js
> ├── elm-package.json
> ├── index.html
> └── src
> └── MyModule.elm
>
> and I try to launch elm-repl from the root with no parameters. In the repl
> I try to import with `import MyModule` which reports:
> elm-make: elm-stuff/build-artifacts/0.17.0/user/project/1.0.0/Repl.elmo:
> openFile: does not exist (No such file or directory)
>
>
>
> On Thursday, May 26, 2016 at 11:26:46 PM UTC+9, Max Goldstein wrote:
>>
>> Have a look at elm-package.json. It lists the source directories, and
>> probably had . instead of ./src.
>
> --
> 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: Best practice for hover

2016-05-27 Thread Alexandre Galays
If CSS transitions are too limited (they often are :( ), Gage Peterson is 
right about having to put that "state" in your model, there really isn't 
any alternative in Elm (apart from delegating to some JS code to do it 
instead but that lowers the maintenance fun)

Just wanted to correct one thing: Component local state is not considered a 
bad practice in React, at all. Lifting state such as "whether a select 
dropdown is opened", "the component has focus", "which grid row is 
currently highlighted" or in general any state that should reset should a 
component be unmounted/remounted to the global state atom is a bad move. 
That leaves the responsibility of determining by experience whether a piece 
of data is state or props, and people make so many mistakes doing that. 
Thankfully, The Elm language make the single atom approach much less 
painful than in JS thanks to pattern matching and terse Record updates.



On Friday, May 27, 2016 at 7:15:27 PM UTC+2, Gage Peterson wrote:
>
> This may not be a satisfactory answer but you could just do it with CSS 
> animations. Doing it in elm requires that the state reside somewhere in the 
> model. There's no "state" part like in React (now considered mostly a bad 
> practice even in that community). 
>
> On Friday, May 27, 2016 at 4:46:06 AM UTC-6, John Watson wrote:
>>
>> If I have a bunch of buttons that all need to respond to mouseOver 
>> 'hover' in the same way, what's the best practice for implementing this in 
>> elm?  I have so far looked at mdgriffith/elm-style-animation.  This seems 
>> fine although I wondered if using this for such simple behaviour was 
>> overkill.  As far as I can see I need to keep track of state for each 
>> button and allocate an id to each.
>>
>

-- 
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 can the source code for the Html module not use a type variable after Html?

2016-05-27 Thread Janis Voigtländer
What you can do if you really want, and in some parts of your code only
have, nodes that come without event handlers, is this:

type alias StaticHtml = Html Never
tableCell : a -> StaticHtmltableCell data =
   td [] [text (toString data)]

If eventually you need to embed this into views that do have buttons etc.,
you can use the function static from
http://package.elm-lang.org/packages/elm-community/html-extra/latest/Html-Extra,
which will let you turn StaticHtml into arbitrary Html msg.
​

2016-05-27 18:19 GMT+02:00 Ray Toal :

> Yes, thanks, right there on the top of the my screen is the old
> evancz/elm-html. I should have paid more attention. Okay, found
> elm-lang/elm-html. I knew it moved...going to have to stop using Google as
> my entry into the documentation, as it will take the search giant a while
> to make the top search result for "elm html package" to STOP pointing to
> http://package.elm-lang.org/packages/evancz/elm-html/4.0.2/ and instead
> go to http://package.elm-lang.org/packages/elm-lang/html/1.0.0/Html.
>
> My bad, thanks again.
>
> On Friday, May 27, 2016 at 8:50:36 AM UTC-7, Janis Voigtländer wrote:
>>
>> You are looking at outdated documentation. That's all. The current
>> documentation of td has the type variable.
>>
>> Am 27.05.2016 um 17:42 schrieb Ray Toal :
>>
>> Hi
>>
>> I wanted to write
>>
>> tableCell : a -> Html
>> tableCell data =
>>   td [] [text (toString data)]
>>
>>
>> but I got an error so I had to write
>>
>> tableCell : a -> Html b
>> tableCell data =
>>   td [] [text (toString data)]
>>
>>
>> This makes sense because in the REPL we see
>>
>> > td
>>
>>  : List (Html.Attribute a) -> List (Html.Html a) -> Html.Html a
>>
>>
>> Now ignoring the fact that the type variable seems silly, even though I
>> am sure somewhere there is a good reason for it (yes, Html aliases
>> VirtualDom.Node), I was really baffled to find out in the Html module
>> itself that td was defined **without** the extra type variable! Straight
>> from the source:
>>
>> {-| Represents a data cell in a table. -}
>> td : List Attribute -> List Html -> Html
>> td =
>>   node "td"
>>
>>
>> In fact the documentation for the Html module is full of those kinds of
>> type signatures. So two questions:
>>
>> 1. How the heck did they get away with that?
>>
>> 2. Is there any way we can do this in our own code? I mean, I wanted to
>> just say the type of the tableCell function is `a -> Html`. The thing is
>> "just a node." What is the extra type variable for anyway? Like I say, I am
>> sure it is useful or necessary but it looks kinda weird. Why can't we just
>> have something that is "just a node"? If Html is not that thing, what is?
>>
>> 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...@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.


Re: [elm-discuss] Why can the source code for the Html module not use a type variable after Html?

2016-05-27 Thread Ray Toal
Yes, thanks, right there on the top of the my screen is the old 
evancz/elm-html. I should have paid more attention. Okay, found 
elm-lang/elm-html. I knew it moved...going to have to stop using Google as 
my entry into the documentation, as it will take the search giant a while 
to make the top search result for "elm html package" to STOP pointing 
to http://package.elm-lang.org/packages/evancz/elm-html/4.0.2/ and instead 
go to http://package.elm-lang.org/packages/elm-lang/html/1.0.0/Html.

My bad, thanks again.

On Friday, May 27, 2016 at 8:50:36 AM UTC-7, Janis Voigtländer wrote:
>
> You are looking at outdated documentation. That's all. The current 
> documentation of td has the type variable. 
>
> Am 27.05.2016 um 17:42 schrieb Ray Toal :
>
> Hi
>
> I wanted to write
>
> tableCell : a -> Html
> tableCell data =
>   td [] [text (toString data)]
>
>
> but I got an error so I had to write
>
> tableCell : a -> Html b
> tableCell data =
>   td [] [text (toString data)]
>
>
> This makes sense because in the REPL we see
>
> > td
>
>  : List (Html.Attribute a) -> List (Html.Html a) -> Html.Html a
>
>
> Now ignoring the fact that the type variable seems silly, even though I am 
> sure somewhere there is a good reason for it (yes, Html aliases 
> VirtualDom.Node), I was really baffled to find out in the Html module 
> itself that td was defined **without** the extra type variable! Straight 
> from the source:
>
> {-| Represents a data cell in a table. -}
> td : List Attribute -> List Html -> Html
> td =
>   node "td"
>
>
> In fact the documentation for the Html module is full of those kinds of 
> type signatures. So two questions:
>
> 1. How the heck did they get away with that?
>
> 2. Is there any way we can do this in our own code? I mean, I wanted to 
> just say the type of the tableCell function is `a -> Html`. The thing is 
> "just a node." What is the extra type variable for anyway? Like I say, I am 
> sure it is useful or necessary but it looks kinda weird. Why can't we just 
> have something that is "just a node"? If Html is not that thing, what is?
>
> 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...@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] Why can the source code for the Html module not use a type variable after Html?

2016-05-27 Thread Janis Voigtländer
You are looking at outdated documentation. That's all. The current 
documentation of td has the type variable. 

> Am 27.05.2016 um 17:42 schrieb Ray Toal :
> 
> Hi
> 
> I wanted to write
> 
> tableCell : a -> Html
> tableCell data =
>   td [] [text (toString data)]
> 
> but I got an error so I had to write
> 
> tableCell : a -> Html b
> tableCell data =
>   td [] [text (toString data)]
> 
> This makes sense because in the REPL we see
> 
> > td
> 
>  : List (Html.Attribute a) -> List (Html.Html a) -> Html.Html a
> 
> 
> 
> Now ignoring the fact that the type variable seems silly, even though I am 
> sure somewhere there is a good reason for it (yes, Html aliases 
> VirtualDom.Node), I was really baffled to find out in the Html module itself 
> that td was defined **without** the extra type variable! Straight from the 
> source:
> 
> {-| Represents a data cell in a table. -}
> td : List Attribute -> List Html -> Html
> td =
>   node "td"
> 
> In fact the documentation for the Html module is full of those kinds of type 
> signatures. So two questions:
> 
> 1. How the heck did they get away with that?
> 
> 2. Is there any way we can do this in our own code? I mean, I wanted to just 
> say the type of the tableCell function is `a -> Html`. The thing is "just a 
> node." What is the extra type variable for anyway? Like I say, I am sure it 
> is useful or necessary but it looks kinda weird. Why can't we just have 
> something that is "just a node"? If Html is not that thing, what is?
> 
> 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.

-- 
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: how to stop subscription?

2016-05-27 Thread Gage Peterson
Wow! I didn't know that.

On Fri, May 27, 2016 at 2:37 AM James Wilson  wrote:

> Correct: Every time the global update function in your app runs for any
> reason, the global subscriptions object is reevaluated as well, and effect
> managers receive the new list of current subscriptions.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/7iorvKOUjJk/unsubscribe.
> To unsubscribe from this group and all its topics, 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: unexpected behavior when double nesting modules

2016-05-27 Thread Janis Voigtländer
Thanks to @Iznaak!

> Am 27.05.2016 um 16:01 schrieb John Askew :
> 
> Yes, updating to elm-lang/virtual-dom to 1.0.2 has fixed my issue.
> 
> https://github.com/elm-lang/virtual-dom/pull/20/files
> 
> Thanks!
> John
> 
>> On Friday, May 27, 2016 at 2:03:01 AM UTC-4, Janis Voigtländer wrote:
>> It’s probably fixed by 1.0.2 of elm-lang/virtual-dom now.
>> 
>> 
>> 2016-05-26 17:24 GMT+02:00 John Askew :
>>> Hi Janis,
>>> 
>>> I am using
>>> 
>>> elm-lang/core 4.0.1
>>> elm-lang/html 1.0.0
>>> elm-lang/virtual-dom 1.0.1
>>> 
>>> so the fix in 4.0.1 (commit cce1dc5?) does not appear to resolve my issue. 
>>> I am chaining two of Html.App.map though, so it could be related.
>>> 
>>> Thanks,
>>> John
>>> 
 On Thursday, May 26, 2016 at 10:25:28 AM UTC-4, Janis Voigtländer wrote:
 If that’s indeed what you ran into, it would be good if you can check it 
 persists when using version 4.0.1 of core, and report back whether or not 
 that version fixes things for you.
 
 
 2016-05-26 16:20 GMT+02:00 Janis Voigtländer :
> It could be this: https://github.com/elm-lang/virtual-dom/issues/21, if 
> your nesting means that you have to repeatedly Html.App.map messages to 
> route them around.
> 
> 
> 2016-05-26 15:31 GMT+02:00 John Askew :
>> Hi Max,
>> 
>> The results of that bug do sound similar, but I tried your suggestion of 
>> deleting the cache and rebuilding (and even building from scratch in a 
>> fresh environment), and the issue still remains. So I don't think that 
>> specific bug is causing it.
>> 
>> Thanks,
>> John
>> 
>>> On Thursday, May 26, 2016 at 12:49:29 AM UTC-4, Max Goldstein wrote:
>>> Hi John,
>>> 
>>> It sounds like this bug: https://github.com/elm-lang/elm-make/issues/72
>>> 
>>> It sounds like you've found a workaround, but you can try removing 
>>> elm-stuff/build-artifacts/ and compiling again. That should work 
>>> (assuming it's indeed the same issue).
>> 
>> -- 
>> 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.


Re: [elm-discuss] proof of concept share/import feature for elm-lang.org/try

2016-05-27 Thread Paul Brauner
Evan's comment on the issue sounds as if he thinks the code has to be
stored serverside or something. Otherwise I'm not sure where the
maintenance burden he's referring to lies.

Paul

On Fri, May 27, 2016 at 10:20 AM Matteo Bertini 
wrote:

> Il giorno giovedì 26 maggio 2016 19:55:26 UTC+2, Nick H ha scritto:
>>
>> Sounds like you should check out (and maybe contribute to) ElmFiddle.io!
>>
>
> I'd like to have this basic functionality in the official "try" too, but
> I'll have a look at ElmFiddle.io !
>
> --
> 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: Import module from src directory in elm-repl

2016-05-27 Thread Shump
My elm-package.json has the following entry:
...
"source-directories": [
"src"
],
...

and my directory looks like this (minus elm-stuff folder in the root)
.
├── build
│   └── MyModule.js
├── elm-package.json
├── index.html
└── src
└── MyModule.elm

and I try to launch elm-repl from the root with no parameters. In the repl 
I try to import with `import MyModule` which reports:
elm-make: elm-stuff/build-artifacts/0.17.0/user/project/1.0.0/Repl.elmo: 
openFile: does not exist (No such file or directory)



On Thursday, May 26, 2016 at 11:26:46 PM UTC+9, Max Goldstein wrote:
>
> Have a look at elm-package.json. It lists the source directories, and 
> probably had . instead of ./src. 

-- 
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: Elm 0.16 access

2016-05-27 Thread Alexey Shamrin


> So, while I'm mostly interested in seeing 0.17 get fleshed out, I think 
> having a link on the front page of elm-lang.org that would take one back 
> to the 0.16 world would be a good thing while 0.17 matures. 
>

By the way, Elm 0.16 world lives at http://elm-lang.org:1234 
. Old /try and /docs are there.

Source: https://twitter.com/czaplic/status/730097524443258880

-- 
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] interesting article

2016-05-27 Thread James Wilson
Other bits I learned from chatting to Jean were

- SAM decouples the code that decides what effects to produce from the message. 
This would basically mean splitting the update function into two parts; update 
the model first, and then inspect the new model only to decide which effect to 
run.
- SAM also allows you to completely ignore model updates if you like. Building 
on the above this would mean the function that updates the model retuning a 
book denoting whether it changed anything, so that the function responsible for 
running effect based on the model can be told not to bother.

I think it's all possible in Elm basically, and when I was working on code 
snippets I found times when I really wanted effects based on messages as well 
and it seemed to simplify things, and I struggled to see the concrete benefits 
of forcing a decoupling from the POV of implementing SAM 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.


Re: [elm-discuss] proof of concept share/import feature for elm-lang.org/try

2016-05-27 Thread Matteo Bertini
Il giorno giovedì 26 maggio 2016 19:55:26 UTC+2, Nick H ha scritto:
>
> Sounds like you should check out (and maybe contribute to) ElmFiddle.io!
>

I'd like to have this basic functionality in the official "try" too, but 
I'll have a look at ElmFiddle.io !

-- 
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: How can I do module level configuration?

2016-05-27 Thread Simon
I'm building quite a large app at present and find myself passing more and 
more into the view functions in addition to that component's model. I feel 
reassured knowing that the view function can't mess with any state and the 
diffing engine is ensuring that I'm not causing more DOM work than 
necessary. 

The inability to capture even micro amounts of state in components will 
either be one of Elm's long term contributions to front end programming or 
part of its eventual sidelining by a broader community - I don't know which 
though.



On Friday, 27 May 2016 07:28:57 UTC+2, Ian Mackenzie wrote:
>
> I think the first solution (context/options argument) is the clearest and 
> simplest. Yes, it's a bit verbose, but:
>
>- You can use the 'view' and 'viewWithOptions' pattern where the 
>former calls the latter with a default primary color etc., so you can get 
>convenience if you don't care about customizability
>- Users can easily do something like `myView = viewWithOptions 
>myOptions' in their own code and then just use that partially-applied 
>function everywhere (with the advantage that they can control exactly 
> where 
>and how the partial application happens)
>- It's very clear what's going on - one of the things I love about Elm 
>is that it's much easier than other languages to trace the flow of logic 
>and see how things work without having to worry about hidden/implicit 
> state 
>or context. Creating a module-like record seems to move a little ways in 
>the 'magic' direction...
>
>

-- 
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] one message calls two messages

2016-05-27 Thread 'Dave Keen' via Elm Discuss
You can use 
http://package.elm-lang.org/packages/ccapndave/elm-update-extra/1.0.0/Update-Extra
 (this is a neater way of calling update recursively)

-- 
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: how to stop subscription?

2016-05-27 Thread 诺铁
I add a "shouldStop: Bool" flag to the model. and check it in subscription
definition:

subscriptions : Model -> Sub Msg
> subscriptions model =
>   if model.shouldStop then
> Sub.none
>   else
> Time.every second Tick


It works!  but this confuse me.
doesn't this mean,whenever model is changed, the subscription is
reevaluated?

On Fri, May 27, 2016 at 2:11 PM, Gage Peterson  wrote:

> I'm not sure it's possible at this point. One way would be to simply
> ignore them based on some state in the model. Like a boolean called
> "trackTime" that would only react to the time if it was true.
>
>
> On Thursday, May 26, 2016 at 8:53:08 PM UTC-6, 大魔头 wrote:
>>
>> hi,
>>
>> in the guide http://guide.elm-lang.org/architecture/effects/time.html
>> there is an exercise:
>>
>> Exercises:
>>
>>- Add a button to pause the clock, turning the Time subscription off.
>>
>> but I search the api doc, and didn't find out how to do this? any hints?
>>
> --
> 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: how to stop subscription?

2016-05-27 Thread Gage Peterson
I'm not sure it's possible at this point. One way would be to simply ignore 
them based on some state in the model. Like a boolean called "trackTime" 
that would only react to the time if it was true. 

On Thursday, May 26, 2016 at 8:53:08 PM UTC-6, 大魔头 wrote:
>
> hi,
>
> in the guide http://guide.elm-lang.org/architecture/effects/time.html
> there is an exercise:
>
> Exercises:
>
>- Add a button to pause the clock, turning the Time subscription off.
>
> but I search the api doc, and didn't find out how to do this? any hints?
>

-- 
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: unexpected behavior when double nesting modules

2016-05-27 Thread Janis Voigtländer
It’s probably fixed by 1.0.2 of elm-lang/virtual-dom now.
​

2016-05-26 17:24 GMT+02:00 John Askew :

> Hi Janis,
>
> I am using
>
> elm-lang/core 4.0.1
> elm-lang/html 1.0.0
> elm-lang/virtual-dom 1.0.1
>
> so the fix in 4.0.1 (commit cce1dc5?) does not appear to resolve my issue.
> I am chaining two of Html.App.map though, so it could be related.
>
> Thanks,
> John
>
> On Thursday, May 26, 2016 at 10:25:28 AM UTC-4, Janis Voigtländer wrote:
>>
>> If that’s indeed what you ran into, it would be good if you can check it
>> persists when using version 4.0.1 of core, and report back whether or
>> not that version fixes things for you.
>> ​
>>
>> 2016-05-26 16:20 GMT+02:00 Janis Voigtländer :
>>
>>> It could be this: https://github.com/elm-lang/virtual-dom/issues/21, if
>>> your nesting means that you have to repeatedly Html.App.map messages to
>>> route them around.
>>> ​
>>>
>>> 2016-05-26 15:31 GMT+02:00 John Askew :
>>>
 Hi Max,

 The results of that bug do sound similar, but I tried your suggestion
 of deleting the cache and rebuilding (and even building from scratch in a
 fresh environment), and the issue still remains. So I don't think that
 specific bug is causing it.

 Thanks,
 John

 On Thursday, May 26, 2016 at 12:49:29 AM UTC-4, Max Goldstein wrote:
>
> Hi John,
>
> It sounds like this bug:
> https://github.com/elm-lang/elm-make/issues/72
>
> It sounds like you've found a workaround, but you can try
> removing elm-stuff/build-artifacts/ and compiling again. That should work
> (assuming it's indeed the same issue).
>
 --
 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.