[elm-discuss] Re: Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
Sorry, I'm still not sure how to pass a received date or model to 
comparison function.

On Tuesday, November 22, 2016 at 3:41:07 AM UTC+1, Max Goldstein wrote:
>
> You can partially apply the comparison function to the current date before 
> passing it to List.filter. The trick is that you have to get the current 
> date through a command, and either run the filter when the command comes 
> back, or keep the current date in the model. 

-- 
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] Unpublishing a package

2016-11-21 Thread Matthieu Pizenberg
On Tuesday, November 22, 2016 at 1:52:09 PM UTC+8, Peter Damoc wrote:
>
> On Tue, Nov 22, 2016 at 1:33 AM, Richard Feldman  > wrote:
>
>> There is no unpublish feature, and it's important that there never be one 
>> . :)
>>
>
> What would happen if someone deletes their github repository? Wouldn't the 
> same kind of breakage take place?
>

 Is it what happened to elm-community/elm-function-extra 

?

-- 
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] Unpublishing a package

2016-11-21 Thread Peter Damoc
On Tue, Nov 22, 2016 at 8:10 AM, Richard Feldman <
richard.t.feld...@gmail.com> wrote:

> What would happen if someone deletes their github repository? Wouldn't the
>> same kind of breakage take place?
>>
>
> Yep, but that's a flaw in the current implementation (which was chosen for
> expedience), not a desired feature of the design.
>
> The longer-term plan (which might be happening in 0.19) is for packages to
> be downloaded from somewhere other than the source repo.
>
> It would be awesome to have a peer-to-peer structure where one would have
at least 3 peers for most packages:
the github repository, an official elm-lang server cache of all the tagged
repositories and a local machine peer.

Companies developing with Elm could also have a company peer.  :)





-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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] Unpublishing a package

2016-11-21 Thread Richard Feldman

>
> What would happen if someone deletes their github repository? Wouldn't the 
> same kind of breakage take place? 
>

Yep, but that's a flaw in the current implementation (which was chosen for 
expedience), not a desired feature of the design.

The longer-term plan (which might be happening in 0.19) is for packages to 
be downloaded from somewhere other than the source repo.

-- 
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] Unpublishing a package

2016-11-21 Thread Zachary Kessin
> What about a way to hide packages during search (unless you ask for
them), but still be available to download?
>

I like this solution

Zach
ᐧ

On Tue, Nov 22, 2016 at 4:35 AM, Max Goldstein 
wrote:

> What about a way to hide packages during search (unless you ask for them),
> but still be available to download?
>
> --
> 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.
>



-- 
Zach Kessin
SquareTarget 
Twitter: @zkessin 
Skype: zachkessin

-- 
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] Unpublishing a package

2016-11-21 Thread Peter Damoc
On Tue, Nov 22, 2016 at 1:33 AM, Richard Feldman <
richard.t.feld...@gmail.com> wrote:

> There is no unpublish feature, and it's important that there never be one
> . :)
>

What would happen if someone deletes their github repository? Wouldn't the
same kind of breakage take place?



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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] Can't install native package using elm-github-install

2016-11-21 Thread Gusztáv Szikszai
I think you are looking for something like 
this: 
https://github.com/gdotdesign/elm-ui/blob/master/source/Ui/Helpers/Emitter.elm 
It's a pure Elm pub / sub effects module (and possibly the most minimal 
example of an effect module).

On Monday, November 21, 2016 at 11:54:50 PM UTC+1, Rupert Smith wrote:
>
> On Friday, November 18, 2016 at 3:50:51 PM UTC, OvermindDL1 wrote:
>>
>>
>> On Friday, November 18, 2016 at 5:18:27 AM UTC-7, Rupert Smith wrote:
>>>
>>> I found using a port to enable global communication with the Auth module 
>>> from anywhere in my application (any time you get a 401 or 403 you invoke 
>>> 'unauthed') to be quite convenient. Perhaps I might find a better solution 
>>> to this using out messages, or perhaps Elm will eventually develop some 
>>> sort of pub/sub messaging mechanism that I could use instead.
>>>
>>
>> It has that, they are called subscriptions.  ^.^
>>
>> Subscriptions link to an Effect Module, you can make your own 
>> subscriptions via making an effect module (with potentially native module 
>> code used by it as well to properly hide all the internals). 
>>
>
> Is there any documentation on effects modules? I can kind of guess form 
> looking at source code on github for 'navigation', 'window', 'mouse', etc, 
> but it takes a bit of figuring out. I think in this case, an effects module 
> is not really what I am after, I might be better just to replace what I did 
> with 'out messages', and then at least my code would be pure Elm. But I got 
> curious now to have a little play around and try to understand effects 
> anyway.
>

-- 
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] Proposed addition for Task package

2016-11-21 Thread Nick H
👍👍👍

On Mon, Nov 21, 2016 at 7:04 PM, Charlie Koster  wrote:

> I'm a fan of the changes to Task.perform in Elm 0.18. However, I'm still
> finding that I'm writing a lot of boilerplate in some situations. For
> example, there are several instances when I want to send a msg which has no
> payload.
>
> Task.perform (\_ -> GoToLoginPage) (Task.succeed Nothing)
>
> I do this any time I am navigating to a different page, submitting a form,
> cancelling a form, kicking off any asynchronous request (logging in,
> CRUDing any data), and maybe one or two other special cases.
>
> I don't see any reason why not have a function in Task that takes a msg
> and returns a Cmd msg.
>
> sendMsg : msg -> Cmd msg
>
> Which could be used like this
>
> Task.sendMsg GoToLoginPage
> Task.sendMsg GoToOneOfTenOtherPages
> Task.sendMsg IsFetchingData
> Task.sendMsg IsUpdatingData
> Task.sendMsg IsCreatingData
> Task.sendMsg IsDeletingData
> Task.sendMsg CancelCreate
> Task.sendMsg CancelDelete
> Task.sendMsg LogoutSucceed
> ...
>
> Any thoughts on this proposed addition? Does anyone else find themselves
> writing a lot of boilerplate with Task.perform?
>
> --
> 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] Proposed addition for Task package

2016-11-21 Thread Charlie Koster
I'm a fan of the changes to Task.perform in Elm 0.18. However, I'm still 
finding that I'm writing a lot of boilerplate in some situations. For 
example, there are several instances when I want to send a msg which has no 
payload.

Task.perform (\_ -> GoToLoginPage) (Task.succeed Nothing)

I do this any time I am navigating to a different page, submitting a form, 
cancelling a form, kicking off any asynchronous request (logging in, 
CRUDing any data), and maybe one or two other special cases.

I don't see any reason why not have a function in Task that takes a msg and 
returns a Cmd msg.

sendMsg : msg -> Cmd msg

Which could be used like this

Task.sendMsg GoToLoginPage
Task.sendMsg GoToOneOfTenOtherPages
Task.sendMsg IsFetchingData
Task.sendMsg IsUpdatingData
Task.sendMsg IsCreatingData
Task.sendMsg IsDeletingData
Task.sendMsg CancelCreate
Task.sendMsg CancelDelete
Task.sendMsg LogoutSucceed
...

Any thoughts on this proposed addition? Does anyone else find themselves 
writing a lot of boilerplate with Task.perform?

-- 
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: Current date (sorry for starting it again)

2016-11-21 Thread Max Goldstein
You can partially apply the comparison function to the current date before 
passing it to List.filter. The trick is that you have to get the current date 
through a command, and either run the filter when the command comes back, or 
keep the current date in the model. 

-- 
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] Unpublishing a package

2016-11-21 Thread Max Goldstein
What about a way to hide packages during search (unless you ask for them), but 
still be available to download?

-- 
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] Can Javascript to start Elm app be attached per page?

2016-11-21 Thread Brian Marick
I figured out how to make it work, thanks to your help. Because there are some 
fiddly bits, I wrote up a blog post that points to a frozen branch that might 
help others. It’s here:

http://blog.roundingpegs.com/phoenix-elm-and-multiple-single-page-apps/


> On Nov 21, 2016, at 11:43 AM, OvermindDL1  wrote:
> 
> A few things (as I do use elm with phoenix):
> 
> 1. Make sure the script tag is loaded before you load a page specific call 
> like require or so (my script sends a 'js-loaded' event when done that my 
> pages can listen to if it is not already sent, a simple function in the head 
> can simplify that to a single call).
> 2. I like to pack all my elm apps into a single file (which is then stuffed 
> inside app.js and minimized and such).  My individual pages just call 
> `require("web/static/elm.js").whateverApp.embed(blah);`, thus the individual 
> pages determine what they call, not a lot of checks in the javascript.  :-)
> 
> 
> On Sunday, November 20, 2016 at 4:31:15 PM UTC-7, Brian Marick wrote:
> Note: newbie to Javascript and frontend in general. 
> 
> TL/DR: I would like to see an example of the Best Way to (1) have N urls 
> invoke N single-page Elm apps, and (2) pass each of them url-specific flags 
> (to be received by  `Html.App.programWithFlags`). 
> 
> - 
> 
> The Elixir/Phoenix book [1] suggests having a single “app.js” file, compiled 
> by Brunch. Part of the code compiled into that single file contains specific 
> tests of the form “Am I on the page where behavior X is appropriate? If so, 
> run this (page-specific) code to cause behavior X.” Given that my code for X 
> is written in Elm, the source for the Brunch compilation contains code like 
> this: 
> 
> import Elm from './critter4us' 
> 
> const ivDiv = document.querySelector('#iv-target'); 
> if (ivDiv) { 
> Elm.IV.embed(ivDiv); 
> } 
> 
> const animalsDiv = document.querySelector('#animals-target'); 
> if (animalsDiv) { 
>  Elm.Animals.embed(animalsDiv, { 
> authToken: window.auth_token, 
> }); 
> } 
> 
> // etc. 
> 
> Note that the arguments are passed to Elm by cramming them into global 
> variables before the “app.js” file is loaded. That is: 
> 
> window.auth_token = "<%= assigns[:auth_token] %>" 
> "> 
> 
> --- 
> 
> I can imagine having a whole sequence of such `if` tests in the master 
> javascript file, one for each Elm-enabled page. But that seems really 
> convoluted. It seems it would be better for each page to request a single 
> library (app.js, loaded from cache), then have a snippet of code that 
> launches the Elm app. 
> 
> That is, following: 
> 
> "> 
> 
> would be a page-specific: 
> 
>  
>   Elm.Animals.embed("#animals-target", { 
>   authToken: “fe9c6177-02df-4510-88fd-4c1bbe023d16", 
>   …} 
>  
> 
> (Note: no need to cram values into `window`.) 
> 
> But I can’t make that work. Can someone point me to examples? 
> 
> 
> ——— 
> 
> [1] https://pragprog.com/book/phoenix/programming-phoenix 
> 
> 
> -- 
> 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] Unpublishing a package

2016-11-21 Thread Noah Hall
The elm-community has been depreciating things every time a new Elm
release comes along, by simply just not publishing for that version.

On Tue, Nov 22, 2016 at 12:33 AM, Richard Feldman
 wrote:
> There is no unpublish feature, and it's important that there never be one.
> :)
>
> If you want to deprecate a package, I recommend publishing a new major
> release that removes everything and replaces the README with an explanation
> of how the package is gone now (and perhaps what to use instead).
>
> --
> 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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread joseph ni
I came to Elm not knowing about the Maybe type. 
The hardest thing for me to grasp was the use case and being able to map : 
(a -> b) -> Maybe a -> Maybe b. And knowing when to use a Maybe (rarely) vs 
when to use a union type or refactor the code so it doesn't need the Maybe 
type.

If I was to qualitatively estimate the amount of time spent learning about 
Maybe. I'd say it took me a moment to understand `Maybe a = Just a | 
Nothing` and a couple of months to get comfortable enough with the Maybe 
type now to understand where it's needed in my app.

So I'd tend to lean with Joey, the wording works for me and changing it 
would feel arbitrary and break the current grammatical 'symmetry' as in
weapon = Just sword 
vs 
weapon = Something sword

On Tuesday, 22 November 2016 08:19:21 UTC+11, Oliver Searle-Barnes wrote:
>
> I have to admit I did find `Just` very confusing when I first encountered 
> it, as mentioned earlier in this thread it implies some kind of limitation 
> which doesn't match the semantics of Maybe at all. That said, it was one of 
> those little oddities that very quickly become second nature, just wanted 
> to point out that it is a slight bump in the road for newcomers.
>
>
> On Monday, 21 November 2016 18:34:05 UTC+1, Noah Hall wrote:
>>
>> Has anyone actually encountered anyone being confused by the names? I 
>> haven't. I think this a solution to a problem that doesn't exist. 
>>
>> On Mon, Nov 21, 2016 at 6:15 PM, Will White  wrote: 
>> > I think that’s because you already know what Just means. I don’t think 
>> it’s 
>> > arbitrary though from an accessibility point of view. Some or None is 
>> easier 
>> > for newcomers to understand than Just or Nothing, especially as Some 
>> isn’t 
>> > misleading the way Just is, as Andrew described well. 
>> > 
>> > On 21 Nov 2016, at 17:05, Joey Eremondi  wrote: 
>> > 
>> > Honestly, these choices seem pretty arbitrary. Everyone has a 
>> preference. ML 
>> > uses Some/None, Haskell uses Just/Nothing. Some people find Something 
>> > intuitive, some don't. 
>> > 
>> > Given that the choices is (mostly) arbitrary, it seems best to stick 
>> with 
>> > the status quo. 
>> > 
>> > On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss 
>> >  wrote: 
>> >> 
>> >> Probably inherited from Haskell, like a lot of other stuff. Doubt if 
>> there 
>> >> was any other thought put into it if I'm honest. 
>> >> 
>> >> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote: 
>> >>> 
>> >>> Sorry, meant to say “I guess he’s already considered and rejected 
>> them”. 
>> >>> 
>> >>> On 21 Nov 2016, at 14:21, Will White  wrote: 
>> >>> 
>> >>> I prefer Some or None, for understanding. Though, unless Evan didn’t 
>> know 
>> >>> about them, I guess we’d already have them. 
>> >>> 
>> >>> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen  
>>
>> >>> wrote: 
>> >>> 
>> >>> How about 'Some' and 'None'? 
>> >>> Those are not longer to type than what we have today, and they should 
>> >>> solve your initial confusion. 
>> >>> 
>> >>> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende: 
>>  
>>  I'm talking about Maybe.Just, of course. Just has always seemed 
>> strange 
>>  to me, as if it's hinting that it's something other than just the 
>>  counterpart to Nothing. I don't know the reasons behind its naming, 
>> but I 
>>  think I would prefer Something, as in "something or nothing". What 
>> do you 
>>  think? 
>> >>> 
>> >>> 
>> >>> -- 
>> >>> 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/EHnuE_gGFuo/unsubscribe. 
>>
>> >>> To unsubscribe from this group and all its topics, 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 a topic in the 
>> > Google Groups "Elm Discuss" group. 
>> > To unsubscribe from this topic, visit 
>> > https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/unsubscribe. 
>> > To unsubscribe from this group and all its topics, 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.

Re: [elm-discuss] Tell me how to teach Web Apps

2016-11-21 Thread Martin DeMello
Some things that might help:

1. typescript 2.0 has a really nice set of type-related features.
https://blog.mariusschulz.com/2016/09/27/typescript-2-0-non-nullable-types

in particular, it has support for lexical closures, immutable ("readonly")
data, and tagged unions, which are over 90% of what i want from a
statically typed functional language.

2. stanza has a good rationale for optional typing:
http://lbstanza.org/optional_typing.html

martin

On Mon, Nov 21, 2016 at 3:43 PM, Robert Muller 
wrote:

> Thank you! I've looked at typescript a bit and I am strongly biased toward
> statically typed PLs but I suppose I'll have to sort out whether or not it
> gets over the "helps them get an opportunity" bar. Is it really reasonably
> mainstream? I'll look into it. Thank you for the suggestion.
> Bob
>
>
> On Monday, November 21, 2016 at 6:26:56 PM UTC-5, Martin DeMello wrote:
>>
>> How about teaching it in typescript + react? Typescript is way better
>> than vanilla javascript, while still being reasonably mainstream and not
>> too different-looking.
>>
>> martin
>>
>> On Mon, Nov 21, 2016 at 3:23 PM, Robert Muller 
>> wrote:
>>
>>> I'm teaching a full-semester course on Web Apps this spring. It's my
>>> first time through so I have a lot to learn. I'm a long-time functional
>>> programmer (mostly ML: SML & OCaml). If I wasn't worried about my students
>>> getting jobs and internships the choice would be obvious: I'd teach Elm!
>>> But the students are taking the course to get jobs and internships and I
>>> have to respect that so I'm looking for advice.
>>> A couple of former students in industry tell me that I definitely need
>>> to cover back-end issues. So I'm considering teaching the front 3/4 of the
>>> course using Node.js + React.js and then integrating Elm in the advanced
>>> topics part during the last 1/4 might be reasonable.
>>>
>>> But maybe not. Please tell share your thoughts with me!
>>>
>>> Bob Muller
>>> Boston College
>>>
>>> --
>>> 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] Tell me how to teach Web Apps

2016-11-21 Thread Robert Muller
Thank you! I've looked at typescript a bit and I am strongly biased toward 
statically typed PLs but I suppose I'll have to sort out whether or not it 
gets over the "helps them get an opportunity" bar. Is it really reasonably 
mainstream? I'll look into it. Thank you for the suggestion.
Bob


On Monday, November 21, 2016 at 6:26:56 PM UTC-5, Martin DeMello wrote:
>
> How about teaching it in typescript + react? Typescript is way better than 
> vanilla javascript, while still being reasonably mainstream and not too 
> different-looking.
>
> martin
>
> On Mon, Nov 21, 2016 at 3:23 PM, Robert Muller  > wrote:
>
>> I'm teaching a full-semester course on Web Apps this spring. It's my 
>> first time through so I have a lot to learn. I'm a long-time functional 
>> programmer (mostly ML: SML & OCaml). If I wasn't worried about my students 
>> getting jobs and internships the choice would be obvious: I'd teach Elm! 
>> But the students are taking the course to get jobs and internships and I 
>> have to respect that so I'm looking for advice.
>> A couple of former students in industry tell me that I definitely need to 
>> cover back-end issues. So I'm considering teaching the front 3/4 of the 
>> course using Node.js + React.js and then integrating Elm in the advanced 
>> topics part during the last 1/4 might be reasonable.
>>
>> But maybe not. Please tell share your thoughts with me!
>>
>> Bob Muller
>> Boston College
>>
>> -- 
>> 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] Unpublishing a package

2016-11-21 Thread Richard Feldman
There is no unpublish feature, and it's important that there never be one 
. :)

If you want to deprecate a package, I recommend publishing a new major 
release that removes everything and replaces the README with an explanation 
of how the package is gone now (and perhaps what to use instead).

-- 
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] Tell me how to teach Web Apps

2016-11-21 Thread Martin DeMello
How about teaching it in typescript + react? Typescript is way better than
vanilla javascript, while still being reasonably mainstream and not too
different-looking.

martin

On Mon, Nov 21, 2016 at 3:23 PM, Robert Muller 
wrote:

> I'm teaching a full-semester course on Web Apps this spring. It's my first
> time through so I have a lot to learn. I'm a long-time functional
> programmer (mostly ML: SML & OCaml). If I wasn't worried about my students
> getting jobs and internships the choice would be obvious: I'd teach Elm!
> But the students are taking the course to get jobs and internships and I
> have to respect that so I'm looking for advice.
> A couple of former students in industry tell me that I definitely need to
> cover back-end issues. So I'm considering teaching the front 3/4 of the
> course using Node.js + React.js and then integrating Elm in the advanced
> topics part during the last 1/4 might be reasonable.
>
> But maybe not. Please tell share your thoughts with me!
>
> Bob Muller
> Boston College
>
> --
> 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] Tell me how to teach Web Apps

2016-11-21 Thread Robert Muller
I'm teaching a full-semester course on Web Apps this spring. It's my first 
time through so I have a lot to learn. I'm a long-time functional 
programmer (mostly ML: SML & OCaml). If I wasn't worried about my students 
getting jobs and internships the choice would be obvious: I'd teach Elm! 
But the students are taking the course to get jobs and internships and I 
have to respect that so I'm looking for advice.
A couple of former students in industry tell me that I definitely need to 
cover back-end issues. So I'm considering teaching the front 3/4 of the 
course using Node.js + React.js and then integrating Elm in the advanced 
topics part during the last 1/4 might be reasonable.

But maybe not. Please tell share your thoughts with me!

Bob Muller
Boston College

-- 
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] highlight.js and elm code

2016-11-21 Thread Brian Marick
I recently installed highlight.js (http://highlightjs.readthedocs.io 
) on my blog. It’s supposed to understand 
Elm code, but the results are not appealing:



Given the same thing happens with Haskell code, I suspect I’m doing something 
wrong. Any advice or experience? 

-- 
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: Passing properties as arguments to messages?

2016-11-21 Thread 'Rupert Smith' via Elm Discuss
On Monday, November 21, 2016 at 6:27:40 PM UTC, Rex van der Spuy wrote:
>
> Is it possible to pass model properties as message arguments and use those 
> arguments to construct a new model?
>

Could use a Dict instead of properties? 

-- 
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] Unpublishing a package

2016-11-21 Thread 'Rupert Smith' via Elm Discuss
On Monday, November 21, 2016 at 6:49:17 PM UTC, Michel Rijnders wrote:
>
> On Monday, November 21, 2016 at 3:40:02 PM UTC+1, Peter Damoc wrote:
>>
>> On Mon, Nov 21, 2016 at 1:42 PM, Michel Rijnders  
>> wrote:
>>
>>> The issue is that somebody forked our package (truqu/elm-base64) and 
>>> published it, so now there's two (nearly) identical packages, potentially 
>>> causing confusion.
>>>
>>
>> This is a more interesting issue to discuss. 
>>
>> On one side, there should be freedom to fork and improved/change a 
>> package (as long as your license allows it). 
>> On the other side, I would not want nearly identical packages creating 
>> noise in the package manager. 
>>
>
> Totally agree, but in our case the fork was done solely because our 
> package hadn't been upgraded to 0.18 yet. So once we upgraded our package 
> there were two indentical packages. (Or nearly identical, because they 
> forgot to upgrade the tests.)
>

I was also wondering if that would happen - In a hurry to bump your code 
but can't be bothered with the tests.

-- 
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] Can't install native package using elm-github-install

2016-11-21 Thread 'Rupert Smith' via Elm Discuss
On Friday, November 18, 2016 at 3:50:51 PM UTC, OvermindDL1 wrote:
>
>
> On Friday, November 18, 2016 at 5:18:27 AM UTC-7, Rupert Smith wrote:
>>
>> I found using a port to enable global communication with the Auth module 
>> from anywhere in my application (any time you get a 401 or 403 you invoke 
>> 'unauthed') to be quite convenient. Perhaps I might find a better solution 
>> to this using out messages, or perhaps Elm will eventually develop some 
>> sort of pub/sub messaging mechanism that I could use instead.
>>
>
> It has that, they are called subscriptions.  ^.^
>
> Subscriptions link to an Effect Module, you can make your own 
> subscriptions via making an effect module (with potentially native module 
> code used by it as well to properly hide all the internals). 
>

Is there any documentation on effects modules? I can kind of guess form 
looking at source code on github for 'navigation', 'window', 'mouse', etc, 
but it takes a bit of figuring out. I think in this case, an effects module 
is not really what I am after, I might be better just to replace what I did 
with 'out messages', and then at least my code would be pure Elm. But I got 
curious now to have a little play around and try to understand effects 
anyway.

-- 
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: Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
But how then to pull current date in the functions where it could not be 
passed? For example I want to List.filter comparing to current date but I 
can not pass additional parameters to comparison function.

On Monday, November 21, 2016 at 8:33:55 PM UTC+1, Tim Bezhashvyly wrote:
>
> Makes sense. Thank you.
>
> On Monday, November 21, 2016 at 8:32:14 PM UTC+1, OvermindDL1 wrote:
>>
>> Date.now would not be a functional call that way (returning the same 
>> output for the same input) thus that could not work (without hacks like 
>> native modules, but that would also break reproduceability).  By making it 
>> an effect it can just return a request to get the actual date.
>>
>>
>> On Monday, November 21, 2016 at 12:29:09 PM UTC-7, Tim Bezhashvyly wrote:
>>>
>>> Sorry for starting it again but do I really need to do Task.perform just 
>>> to print current year just once? "Date.year Date.now" doesn't work as 
>>> Date.now returns Task.Task x Date.Date.
>>>
>>

-- 
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: ANN: update-clock for fixed-time-step game loops

2016-11-21 Thread Nick H
You wouldn't be so sure of what? I am not sure which of my statements you
are responding to.

Network synchronization is a separate (and much more complicated) problem.
This library won't help with that.

On Mon, Nov 21, 2016 at 11:40 AM, Gaëtan André 
wrote:

> I wouldn't be so sure. For example, in networking games where one might
> need to keep clocks synced.
>
> Le dimanche 20 novembre 2016 21:08:37 UTC+1, Nick H adn écrit :
>>
>> The purpose of the Clock is to relate the passage of time in the "real"
>> world to the passage of time in the simulated world. So the Clock is
>> fundamentally something that exists outside of the simulation... there is
>> no need for the simulation to know about it.
>>
>> Having said that, I feel more confident that the Clock doesn't need to
>> keep track of the total elapsed time. A lot of the time, that number won't
>> be needed. And if it is, the simulation can easily keep track of that
>> number itself, given the period.
>>
>>
>>
>> On Sun, Nov 20, 2016 at 1:40 AM, Gaëtan André 
>> wrote:
>>
>>> Passing Clock.period would be indeed more useful in the example's use
>>> case.
>>>
>>> Could we imagine update functions where the total elapsed time is needed?
>>>
>>> Wouldn't it be more flexible to pass the Clock object?
>>>
>>> Le samedi 19 novembre 2016 18:59:02 UTC+1, Nick H a écrit :

 Great questions.

 I am wondering why you don't pass Clock.period to the update method and
> use the global delta instead


 Reasons why period doesn't get passed directly to the update function:

 1. The function would need 5 arguments, and that is too many.

 2. The period is unlikely to change. The Clock needs a period, so we
 may as well set the period on the clock once, and then not worry about it.

 (The same could be said of the physicsUpdate function... we're unlikely
 to ever pass a different function to Clock.update. So why isn't that
 attached to the Clock record too? Because then Clock's type definition
 would need a parameter. Parametrized types are fine. But in this case, I
 thought it was better to add complexity to the function rather than the
 type.)

 is this counter really useful for a physical update? Wouldn't we need
> more the real time (Clock.time*Clock.period)?
>

 You're absolutely right.

 Actually, I think more useful than either Clock.time or
 (Clock.time*Clock.period) might be to just pass Clock.period. That way, we
 wouldn't need that global delta value any more. What do you think about
 that?

 Thanks for taking a look!
 ~Nick

 On Sat, Nov 19, 2016 at 6:01 AM, Gaëtan André 
 wrote:

> Hi Nick,
>
> great effort.
>
> I have been looking for your code and example and I am wondering why
> you don't pass Clock.period to the update method and use the global delta
> instead. You also pass Clock.time a step counter, but this is not used in
> the example, is this counter really useful for a physical update? Wouldn't
> we need more the real time (Clock.time*Clock.period)?
>
> Le mercredi 16 novembre 2016 22:42:37 UTC+1, Nick H a écrit :
>>
>> Sorry about that. Thanks for taking proper credit!
>>
>> On Wed, Nov 16, 2016 at 9:23 AM, Rex van der Spuy > > wrote:
>>
>>> Wow, that's absolutely brilliant!!!
>>> (My username was `d13` by the way - so that was me!)
>>> Congratulations!!!
>>>
>>> --
>>> 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...@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...@googlegrou

Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Oliver Searle-Barnes
I have to admit I did find `Just` very confusing when I first encountered 
it, as mentioned earlier in this thread it implies some kind of limitation 
which doesn't match the semantics of Maybe at all. That said, it was one of 
those little oddities that very quickly become second nature, just wanted 
to point out that it is a slight bump in the road for newcomers.


On Monday, 21 November 2016 18:34:05 UTC+1, Noah Hall wrote:
>
> Has anyone actually encountered anyone being confused by the names? I 
> haven't. I think this a solution to a problem that doesn't exist. 
>
> On Mon, Nov 21, 2016 at 6:15 PM, Will White  > wrote: 
> > I think that’s because you already know what Just means. I don’t think 
> it’s 
> > arbitrary though from an accessibility point of view. Some or None is 
> easier 
> > for newcomers to understand than Just or Nothing, especially as Some 
> isn’t 
> > misleading the way Just is, as Andrew described well. 
> > 
> > On 21 Nov 2016, at 17:05, Joey Eremondi  > wrote: 
> > 
> > Honestly, these choices seem pretty arbitrary. Everyone has a 
> preference. ML 
> > uses Some/None, Haskell uses Just/Nothing. Some people find Something 
> > intuitive, some don't. 
> > 
> > Given that the choices is (mostly) arbitrary, it seems best to stick 
> with 
> > the status quo. 
> > 
> > On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss 
> > > wrote: 
> >> 
> >> Probably inherited from Haskell, like a lot of other stuff. Doubt if 
> there 
> >> was any other thought put into it if I'm honest. 
> >> 
> >> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote: 
> >>> 
> >>> Sorry, meant to say “I guess he’s already considered and rejected 
> them”. 
> >>> 
> >>> On 21 Nov 2016, at 14:21, Will White  wrote: 
> >>> 
> >>> I prefer Some or None, for understanding. Though, unless Evan didn’t 
> know 
> >>> about them, I guess we’d already have them. 
> >>> 
> >>> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen  
> >>> wrote: 
> >>> 
> >>> How about 'Some' and 'None'? 
> >>> Those are not longer to type than what we have today, and they should 
> >>> solve your initial confusion. 
> >>> 
> >>> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende: 
>  
>  I'm talking about Maybe.Just, of course. Just has always seemed 
> strange 
>  to me, as if it's hinting that it's something other than just the 
>  counterpart to Nothing. I don't know the reasons behind its naming, 
> but I 
>  think I would prefer Something, as in "something or nothing". What do 
> you 
>  think? 
> >>> 
> >>> 
> >>> -- 
> >>> 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/EHnuE_gGFuo/unsubscribe. 
>
> >>> To unsubscribe from this group and all its topics, 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 a topic in the 
> > Google Groups "Elm Discuss" group. 
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/unsubscribe. 
> > To unsubscribe from this group and all its topics, 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.


Re: [elm-discuss] Re: ANN: update-clock for fixed-time-step game loops

2016-11-21 Thread Gaëtan André
I wouldn't be so sure. For example, in networking games where one might 
need to keep clocks synced.

Le dimanche 20 novembre 2016 21:08:37 UTC+1, Nick H adn écrit :
>
> The purpose of the Clock is to relate the passage of time in the "real" 
> world to the passage of time in the simulated world. So the Clock is 
> fundamentally something that exists outside of the simulation... there is 
> no need for the simulation to know about it.
>
> Having said that, I feel more confident that the Clock doesn't need to 
> keep track of the total elapsed time. A lot of the time, that number won't 
> be needed. And if it is, the simulation can easily keep track of that 
> number itself, given the period.
>
>
>
> On Sun, Nov 20, 2016 at 1:40 AM, Gaëtan André  > wrote:
>
>> Passing Clock.period would be indeed more useful in the example's use 
>> case.
>>
>> Could we imagine update functions where the total elapsed time is needed?
>>
>> Wouldn't it be more flexible to pass the Clock object?
>>
>> Le samedi 19 novembre 2016 18:59:02 UTC+1, Nick H a écrit :
>>>
>>> Great questions. 
>>>
>>> I am wondering why you don't pass Clock.period to the update method and 
 use the global delta instead
>>>
>>>
>>> Reasons why period doesn't get passed directly to the update function:
>>>
>>> 1. The function would need 5 arguments, and that is too many.
>>>
>>> 2. The period is unlikely to change. The Clock needs a period, so we may 
>>> as well set the period on the clock once, and then not worry about it.
>>>
>>> (The same could be said of the physicsUpdate function... we're unlikely 
>>> to ever pass a different function to Clock.update. So why isn't that 
>>> attached to the Clock record too? Because then Clock's type definition 
>>> would need a parameter. Parametrized types are fine. But in this case, I 
>>> thought it was better to add complexity to the function rather than the 
>>> type.)
>>>
>>> is this counter really useful for a physical update? Wouldn't we need 
 more the real time (Clock.time*Clock.period)?

>>>
>>> You're absolutely right.
>>>
>>> Actually, I think more useful than either Clock.time or 
>>> (Clock.time*Clock.period) might be to just pass Clock.period. That way, we 
>>> wouldn't need that global delta value any more. What do you think about 
>>> that?
>>>
>>> Thanks for taking a look!
>>> ~Nick
>>>
>>> On Sat, Nov 19, 2016 at 6:01 AM, Gaëtan André  
>>> wrote:
>>>
 Hi Nick,

 great effort.

 I have been looking for your code and example and I am wondering why 
 you don't pass Clock.period to the update method and use the global delta 
 instead. You also pass Clock.time a step counter, but this is not used in 
 the example, is this counter really useful for a physical update? Wouldn't 
 we need more the real time (Clock.time*Clock.period)?

 Le mercredi 16 novembre 2016 22:42:37 UTC+1, Nick H a écrit :
>
> Sorry about that. Thanks for taking proper credit!
>
> On Wed, Nov 16, 2016 at 9:23 AM, Rex van der Spuy  
> wrote:
>
>> Wow, that's absolutely brilliant!!!
>> (My username was `d13` by the way - so that was me!)
>> Congratulations!!!
>>
>> -- 
>> 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...@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: Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
Makes sense. Thank you.

On Monday, November 21, 2016 at 8:32:14 PM UTC+1, OvermindDL1 wrote:
>
> Date.now would not be a functional call that way (returning the same 
> output for the same input) thus that could not work (without hacks like 
> native modules, but that would also break reproduceability).  By making it 
> an effect it can just return a request to get the actual date.
>
>
> On Monday, November 21, 2016 at 12:29:09 PM UTC-7, Tim Bezhashvyly wrote:
>>
>> Sorry for starting it again but do I really need to do Task.perform just 
>> to print current year just once? "Date.year Date.now" doesn't work as 
>> Date.now returns Task.Task x Date.Date.
>>
>

-- 
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: Current date (sorry for starting it again)

2016-11-21 Thread OvermindDL1
Date.now would not be a functional call that way (returning the same output 
for the same input) thus that could not work (without hacks like native 
modules, but that would also break reproduceability).  By making it an 
effect it can just return a request to get the actual date.


On Monday, November 21, 2016 at 12:29:09 PM UTC-7, Tim Bezhashvyly wrote:
>
> Sorry for starting it again but do I really need to do Task.perform just 
> to print current year just once? "Date.year Date.now" doesn't work as 
> Date.now returns Task.Task x Date.Date.
>

-- 
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] Unpublishing a package

2016-11-21 Thread OvermindDL1
There is always this:  https://github.com/gdotdesign/elm-github-install
Install via:
```sh

npm install -g elm-github-install

```
With this usage:
```json

# elm-package.json
{
  ...
  "dependencies": {
...
"githubUser/repoName": "desiredVersion <= v < someLargerNumber",
"NoRedInk/nri-elm-css": "1.3.0 <= 1.3.0 < 2.0.0",
...
  }
  ...
}

```
Then this to install them:
```sh

elm-github-install

```


On Monday, November 21, 2016 at 11:49:17 AM UTC-7, Michel Rijnders wrote:
>
> On Monday, November 21, 2016 at 3:40:02 PM UTC+1, Peter Damoc wrote:
>>
>> On Mon, Nov 21, 2016 at 1:42 PM, Michel Rijnders  
>> wrote:
>>
>>> The issue is that somebody forked our package (truqu/elm-base64) and 
>>> published it, so now there's two (nearly) identical packages, potentially 
>>> causing confusion.
>>>
>>
>> This is a more interesting issue to discuss. 
>>
>> On one side, there should be freedom to fork and improved/change a 
>> package (as long as your license allows it). 
>> On the other side, I would not want nearly identical packages creating 
>> noise in the package manager. 
>>
>
> Totally agree, but in our case the fork was done solely because our 
> package hadn't been upgraded to 0.18 yet. So once we upgraded our package 
> there were two indentical packages. (Or nearly identical, because they 
> forgot to upgrade the tests.)
>
> IMO having a way to install packages from other sources than 
> package.elm-lang.org would solve this.
>  
>
>>
>>
>>
>> -- 
>> There is NO FATE, we are the creators.
>> blog: http://damoc.ro/
>>
>

-- 
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] Current date (sorry for starting it again)

2016-11-21 Thread Tim Bezhashvyly
Sorry for starting it again but do I really need to do Task.perform just to 
print current year just once? "Date.year Date.now" doesn't work as Date.now 
returns Task.Task x Date.Date.

-- 
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] Passing properties as arguments to messages?

2016-11-21 Thread Nick H
Nope.




On Mon, Nov 21, 2016 at 10:27 AM, Rex van der Spuy 
wrote:

> Hi Everyone,
>
> Is it possible to pass model properties as message arguments and use those
> arguments to construct a new model?
>
> For example, the only difference between these two messages is the model's
> properties:
>
> AnimateQuestion animMsg ->
>   let
> (newStyle, cmds) =
>   Animation.Messenger.update
> animMsg
> model.questionTextStyle
>   in
>  ({ model
>  | questionTextStyle = newStyle
>  }
>  , cmds
>  )
>
> AnimateAnswer animMsg ->
>   let
> (newStyle, cmds) =
>   Animation.Messenger.update
> animMsg
> model.answerTextStyle
>   in
>  ({ model
>  | answerTextStyle = newStyle
>  }
>  ,
>
> Is it somehow possible to combine these into one message, using a generic
> "property" placeholder that could be provided by the argument?:
>
>  Animate animMsg property ->
>   let
> (newStyle, cmds) =
>   Animation.Messenger.update
> animMsg
> model.property
>   in
>  ({ model
>  | property = newStyle
>  }
>
> That doesn't work of course, but is there some way to make it work?
>
> 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] Unpublishing a package

2016-11-21 Thread Michel Rijnders
On Monday, November 21, 2016 at 3:40:02 PM UTC+1, Peter Damoc wrote:
>
> On Mon, Nov 21, 2016 at 1:42 PM, Michel Rijnders  > wrote:
>
>> The issue is that somebody forked our package (truqu/elm-base64) and 
>> published it, so now there's two (nearly) identical packages, potentially 
>> causing confusion.
>>
>
> This is a more interesting issue to discuss. 
>
> On one side, there should be freedom to fork and improved/change a package 
> (as long as your license allows it). 
> On the other side, I would not want nearly identical packages creating 
> noise in the package manager. 
>

Totally agree, but in our case the fork was done solely because our package 
hadn't been upgraded to 0.18 yet. So once we upgraded our package there 
were two indentical packages. (Or nearly identical, because they forgot to 
upgrade the tests.)

IMO having a way to install packages from other sources than 
package.elm-lang.org would solve this.
 

>
>
>
> -- 
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>

-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Will White
I like that!

type Maybe thing = Some thing | Nothing

> On 21 Nov 2016, at 18:31, William Bailey  wrote:
> 
> type Maybe value = Some value | NoValue
> 
> -- 
> 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/EHnuE_gGFuo/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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread William Bailey
type Maybe value = Some value | NoValue

-- 
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] Passing properties as arguments to messages?

2016-11-21 Thread Rex van der Spuy
Hi Everyone,

Is it possible to pass model properties as message arguments and use those 
arguments to construct a new model?

For example, the only difference between these two messages is the model's 
properties:

AnimateQuestion animMsg ->
  let 
(newStyle, cmds) = 
  Animation.Messenger.update
animMsg
model.questionTextStyle
  in
 ({ model
 | questionTextStyle = newStyle
 }
 , cmds 
 )

AnimateAnswer animMsg ->
  let 
(newStyle, cmds) = 
  Animation.Messenger.update
animMsg
model.answerTextStyle
  in
 ({ model
 | answerTextStyle = newStyle
 }
 ,

Is it somehow possible to combine these into one message, using a generic 
"property" placeholder that could be provided by the argument?:

 Animate animMsg property ->
  let 
(newStyle, cmds) = 
  Animation.Messenger.update
animMsg
model.property
  in
 ({ model
 | property = newStyle
 }

That doesn't work of course, but is there some way to make it work?

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.


Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Peter Damoc
On Mon, Nov 21, 2016 at 7:48 PM, Will White  wrote:

> I remember being confused by Just, and I still find it awkward.
>


It matters less if some other places call it Option
 and the
cases have different names.
If one cares about the idea and the things it allows, they will use it as
it is and move on with the problem at hand.

There will always be people who arrive here with a different background.
There is no way to accommodate all.
So, the only sensible choice is for people accommodate themselves to Elm.

I care less if it is "Some value" or "Just value". Both sound and express
the idea equally well to me.
I will use whatever is there.

-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread OvermindDL1
I highly doubt it would ever be changed, but I significantly prefer the 
OCaml style Some/None to Haskell's Just/Nothing as well.

Although `Thing` and `NoThing` could by funny and descriptive both.  ^.^


On Monday, November 21, 2016 at 10:48:11 AM UTC-7, Will White wrote:
>
> I remember being confused by Just, and I still find it awkward. Hearing 
> Richard F. explain it in his introductory Elm talk 
>  is what prompted me to start 
> this discussion.
>
> On 21 Nov 2016, at 17:33, Noah Hall > 
> wrote:
>
> Has anyone actually encountered anyone being confused by the names? I
> haven't. I think this a solution to a problem that doesn't exist.
>
> On Mon, Nov 21, 2016 at 6:15 PM, Will White  > wrote:
>
> I think that’s because you already know what Just means. I don’t think it’s
> arbitrary though from an accessibility point of view. Some or None is 
> easier
> for newcomers to understand than Just or Nothing, especially as Some isn’t
> misleading the way Just is, as Andrew described well.
>
> On 21 Nov 2016, at 17:05, Joey Eremondi > 
> wrote:
>
> Honestly, these choices seem pretty arbitrary. Everyone has a preference. 
> ML
> uses Some/None, Haskell uses Just/Nothing. Some people find Something
> intuitive, some don't.
>
> Given that the choices is (mostly) arbitrary, it seems best to stick with
> the status quo.
>
> On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss
> > wrote:
>
>
> Probably inherited from Haskell, like a lot of other stuff. Doubt if there
> was any other thought put into it if I'm honest.
>
> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote:
>
>
> Sorry, meant to say “I guess he’s already considered and rejected them”.
>
> On 21 Nov 2016, at 14:21, Will White  wrote:
>
> I prefer Some or None, for understanding. Though, unless Evan didn’t know
> about them, I guess we’d already have them.
>
> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen 
> wrote:
>
> How about 'Some' and 'None'?
> Those are not longer to type than what we have today, and they should
> solve your initial confusion.
>
> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
>
>
> I'm talking about Maybe.Just, of course. Just has always seemed strange
> to me, as if it's hinting that it's something other than just the
> counterpart to Nothing. I don't know the reasons behind its naming, but I
> think I would prefer Something, as in "something or nothing". What do you
> think?
>
>
>
> --
> 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/EHnuE_gGFuo/unsubscribe.
> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/unsubscribe.
> To unsubscribe from this group and all its topics, 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 a topic in the 
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/unsubscribe.
> To unsubscribe from this group and all its topics, 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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Joey Eremondi
True, I like Just because I'm familiar with it. But its name isn't obvious.
Some isn't obvious. Something isn't obvious.

There's really, two ways to understand Just. One is to listen to an
explanation like what Richard gives. The other is to see the definition:

type Maybe a = Just a | Nothing.

A Maybe either contains an "a", which we call the "Just" case, or it
contains no arguments, which we call "Nothing".

"Just" is a mnemonic. It's not the "meaning" of the constructor, it's just
a handy name that lets us get at it. The meaning is the two cases above,
the shape of the type. No name, no matter how informative, can capture that
full meaning.

Honestly, if we're appealing to JS developers, and wanted to change the
name, I'd say "Null" and "NotNull" are the two easiest. But I still prefer
the status quo to this.

On Mon, Nov 21, 2016 at 9:48 AM, Will White  wrote:

> I remember being confused by Just, and I still find it awkward. Hearing
> Richard F. explain it in his introductory Elm talk
>  is what prompted me to start
> this discussion.
>
> On 21 Nov 2016, at 17:33, Noah Hall  wrote:
>
> Has anyone actually encountered anyone being confused by the names? I
> haven't. I think this a solution to a problem that doesn't exist.
>
> On Mon, Nov 21, 2016 at 6:15 PM, Will White 
> wrote:
>
> I think that’s because you already know what Just means. I don’t think it’s
> arbitrary though from an accessibility point of view. Some or None is
> easier
> for newcomers to understand than Just or Nothing, especially as Some isn’t
> misleading the way Just is, as Andrew described well.
>
> On 21 Nov 2016, at 17:05, Joey Eremondi  wrote:
>
> Honestly, these choices seem pretty arbitrary. Everyone has a preference.
> ML
> uses Some/None, Haskell uses Just/Nothing. Some people find Something
> intuitive, some don't.
>
> Given that the choices is (mostly) arbitrary, it seems best to stick with
> the status quo.
>
> On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss
>  wrote:
>
>
> Probably inherited from Haskell, like a lot of other stuff. Doubt if there
> was any other thought put into it if I'm honest.
>
> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote:
>
>
> Sorry, meant to say “I guess he’s already considered and rejected them”.
>
> On 21 Nov 2016, at 14:21, Will White  wrote:
>
> I prefer Some or None, for understanding. Though, unless Evan didn’t know
> about them, I guess we’d already have them.
>
> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen 
> wrote:
>
> How about 'Some' and 'None'?
> Those are not longer to type than what we have today, and they should
> solve your initial confusion.
>
> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
>
>
> I'm talking about Maybe.Just, of course. Just has always seemed strange
> to me, as if it's hinting that it's something other than just the
> counterpart to Nothing. I don't know the reasons behind its naming, but I
> think I would prefer Something, as in "something or nothing". What do you
> think?
>
>
>
> --
> 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/EHnuE_gGFuo/unsubscribe.
> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/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.
>
>
> --
> 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/EHnuE_gGFuo/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"

Re: [elm-discuss] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Will White
I remember being confused by Just, and I still find it awkward. Hearing Richard 
F. explain it in his introductory Elm talk 
 is what prompted me to start this 
discussion.

> On 21 Nov 2016, at 17:33, Noah Hall  wrote:
> 
> Has anyone actually encountered anyone being confused by the names? I
> haven't. I think this a solution to a problem that doesn't exist.
> 
> On Mon, Nov 21, 2016 at 6:15 PM, Will White  wrote:
>> I think that’s because you already know what Just means. I don’t think it’s
>> arbitrary though from an accessibility point of view. Some or None is easier
>> for newcomers to understand than Just or Nothing, especially as Some isn’t
>> misleading the way Just is, as Andrew described well.
>> 
>> On 21 Nov 2016, at 17:05, Joey Eremondi  wrote:
>> 
>> Honestly, these choices seem pretty arbitrary. Everyone has a preference. ML
>> uses Some/None, Haskell uses Just/Nothing. Some people find Something
>> intuitive, some don't.
>> 
>> Given that the choices is (mostly) arbitrary, it seems best to stick with
>> the status quo.
>> 
>> On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss
>>  wrote:
>>> 
>>> Probably inherited from Haskell, like a lot of other stuff. Doubt if there
>>> was any other thought put into it if I'm honest.
>>> 
>>> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote:
 
 Sorry, meant to say “I guess he’s already considered and rejected them”.
 
 On 21 Nov 2016, at 14:21, Will White  wrote:
 
 I prefer Some or None, for understanding. Though, unless Evan didn’t know
 about them, I guess we’d already have them.
 
 On 20 Nov 2016, at 23:41, Robin Heggelund Hansen 
 wrote:
 
 How about 'Some' and 'None'?
 Those are not longer to type than what we have today, and they should
 solve your initial confusion.
 
 søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
> 
> I'm talking about Maybe.Just, of course. Just has always seemed strange
> to me, as if it's hinting that it's something other than just the
> counterpart to Nothing. I don't know the reasons behind its naming, but I
> think I would prefer Something, as in "something or nothing". What do you
> think?
 
 
 --
 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/EHnuE_gGFuo/unsubscribe.
 To unsubscribe from this group and all its topics, 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 a topic in the
>> Google Groups "Elm Discuss" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/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.
> 
> -- 
> 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/EHnuE_gGFuo/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: Can Javascript to start Elm app be attached per page?

2016-11-21 Thread OvermindDL1
A few things (as I do use elm with phoenix):

1. Make sure the script tag is loaded before you load a page specific call 
like require or so (my script sends a 'js-loaded' event when done that my 
pages can listen to if it is not already sent, a simple function in the 
head can simplify that to a single call).
2. I like to pack all my elm apps into a single file (which is then stuffed 
inside app.js and minimized and such).  My individual pages just call 
`require("web/static/elm.js").whateverApp.embed(blah);`, thus the 
individual pages determine what they call, not a lot of checks in the 
javascript.  :-)


On Sunday, November 20, 2016 at 4:31:15 PM UTC-7, Brian Marick wrote:
>
> Note: newbie to Javascript and frontend in general. 
>
> TL/DR: I would like to see an example of the Best Way to (1) have N urls 
> invoke N single-page Elm apps, and (2) pass each of them url-specific flags 
> (to be received by  `Html.App.programWithFlags`). 
>
> - 
>
> The Elixir/Phoenix book [1] suggests having a single “app.js” file, 
> compiled by Brunch. Part of the code compiled into that single file 
> contains specific tests of the form “Am I on the page where behavior X is 
> appropriate? If so, run this (page-specific) code to cause behavior X.” 
> Given that my code for X is written in Elm, the source for the Brunch 
> compilation contains code like this: 
>
> import Elm from './critter4us' 
>
> const ivDiv = document.querySelector('#iv-target'); 
> if (ivDiv) { 
> Elm.IV.embed(ivDiv); 
> } 
>
> const animalsDiv = document.querySelector('#animals-target'); 
> if (animalsDiv) { 
>  Elm.Animals.embed(animalsDiv, { 
> authToken: window.auth_token, 
> }); 
> } 
>
> // etc. 
>
> Note that the arguments are passed to Elm by cramming them into global 
> variables before the “app.js” file is loaded. That is: 
>
> window.auth_token = "<%= assigns[:auth_token] %>" 
> "> 
>
> --- 
>
> I can imagine having a whole sequence of such `if` tests in the master 
> javascript file, one for each Elm-enabled page. But that seems really 
> convoluted. It seems it would be better for each page to request a single 
> library (app.js, loaded from cache), then have a snippet of code that 
> launches the Elm app. 
>
> That is, following: 
>
> "> 
>
> would be a page-specific: 
>
>  
>   Elm.Animals.embed("#animals-target", { 
>   authToken: “fe9c6177-02df-4510-88fd-4c1bbe023d16", 
>   …} 
>  
>
> (Note: no need to cram values into `window`.) 
>
> But I can’t make that work. Can someone point me to examples? 
>
>
> ——— 
>
> [1] https://pragprog.com/book/phoenix/programming-phoenix

-- 
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: Can Javascript to start Elm app be attached per page?

2016-11-21 Thread Andrey N. Ronin
i think tis could help 
you https://blog.diacode.com/page-specific-javascript-in-phoenix-framework-pt-1 
so you can initialize elm app in view specific js file

понедельник, 21 ноября 2016 г., 3:31:15 UTC+4 пользователь Brian Marick 
написал:
>
> Note: newbie to Javascript and frontend in general. 
>
> TL/DR: I would like to see an example of the Best Way to (1) have N urls 
> invoke N single-page Elm apps, and (2) pass each of them url-specific flags 
> (to be received by  `Html.App.programWithFlags`). 
>
> - 
>
> The Elixir/Phoenix book [1] suggests having a single “app.js” file, 
> compiled by Brunch. Part of the code compiled into that single file 
> contains specific tests of the form “Am I on the page where behavior X is 
> appropriate? If so, run this (page-specific) code to cause behavior X.” 
> Given that my code for X is written in Elm, the source for the Brunch 
> compilation contains code like this: 
>
> import Elm from './critter4us' 
>
> const ivDiv = document.querySelector('#iv-target'); 
> if (ivDiv) { 
> Elm.IV.embed(ivDiv); 
> } 
>
> const animalsDiv = document.querySelector('#animals-target'); 
> if (animalsDiv) { 
>  Elm.Animals.embed(animalsDiv, { 
> authToken: window.auth_token, 
> }); 
> } 
>
> // etc. 
>
> Note that the arguments are passed to Elm by cramming them into global 
> variables before the “app.js” file is loaded. That is: 
>
> window.auth_token = "<%= assigns[:auth_token] %>" 
> "> 
>
> --- 
>
> I can imagine having a whole sequence of such `if` tests in the master 
> javascript file, one for each Elm-enabled page. But that seems really 
> convoluted. It seems it would be better for each page to request a single 
> library (app.js, loaded from cache), then have a snippet of code that 
> launches the Elm app. 
>
> That is, following: 
>
> "> 
>
> would be a page-specific: 
>
>  
>   Elm.Animals.embed("#animals-target", { 
>   authToken: “fe9c6177-02df-4510-88fd-4c1bbe023d16", 
>   …} 
>  
>
> (Note: no need to cram values into `window`.) 
>
> But I can’t make that work. Can someone point me to examples? 
>
>
> ——— 
>
> [1] https://pragprog.com/book/phoenix/programming-phoenix

-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Noah Hall
Has anyone actually encountered anyone being confused by the names? I
haven't. I think this a solution to a problem that doesn't exist.

On Mon, Nov 21, 2016 at 6:15 PM, Will White  wrote:
> I think that’s because you already know what Just means. I don’t think it’s
> arbitrary though from an accessibility point of view. Some or None is easier
> for newcomers to understand than Just or Nothing, especially as Some isn’t
> misleading the way Just is, as Andrew described well.
>
> On 21 Nov 2016, at 17:05, Joey Eremondi  wrote:
>
> Honestly, these choices seem pretty arbitrary. Everyone has a preference. ML
> uses Some/None, Haskell uses Just/Nothing. Some people find Something
> intuitive, some don't.
>
> Given that the choices is (mostly) arbitrary, it seems best to stick with
> the status quo.
>
> On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss
>  wrote:
>>
>> Probably inherited from Haskell, like a lot of other stuff. Doubt if there
>> was any other thought put into it if I'm honest.
>>
>> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote:
>>>
>>> Sorry, meant to say “I guess he’s already considered and rejected them”.
>>>
>>> On 21 Nov 2016, at 14:21, Will White  wrote:
>>>
>>> I prefer Some or None, for understanding. Though, unless Evan didn’t know
>>> about them, I guess we’d already have them.
>>>
>>> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen 
>>> wrote:
>>>
>>> How about 'Some' and 'None'?
>>> Those are not longer to type than what we have today, and they should
>>> solve your initial confusion.
>>>
>>> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:

 I'm talking about Maybe.Just, of course. Just has always seemed strange
 to me, as if it's hinting that it's something other than just the
 counterpart to Nothing. I don't know the reasons behind its naming, but I
 think I would prefer Something, as in "something or nothing". What do you
 think?
>>>
>>>
>>> --
>>> 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/EHnuE_gGFuo/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/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.

-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Will White
I think that’s because you already know what Just means. I don’t think it’s 
arbitrary though from an accessibility point of view. Some or None is easier 
for newcomers to understand than Just or Nothing, especially as Some isn’t 
misleading the way Just is, as Andrew described well.

> On 21 Nov 2016, at 17:05, Joey Eremondi  wrote:
> 
> Honestly, these choices seem pretty arbitrary. Everyone has a preference. ML 
> uses Some/None, Haskell uses Just/Nothing. Some people find Something 
> intuitive, some don't.
> 
> Given that the choices is (mostly) arbitrary, it seems best to stick with the 
> status quo.
> 
> On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss 
> mailto:elm-discuss@googlegroups.com>> wrote:
> Probably inherited from Haskell, like a lot of other stuff. Doubt if there 
> was any other thought put into it if I'm honest.
> 
> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote:
> Sorry, meant to say “I guess he’s already considered and rejected them”.
> 
>> On 21 Nov 2016, at 14:21, Will White > wrote:
>> 
>> I prefer Some or None, for understanding. Though, unless Evan didn’t know 
>> about them, I guess we’d already have them.
>> 
>>> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen > 
>>> wrote:
>>> 
>>> How about 'Some' and 'None'?
>>> Those are not longer to type than what we have today, and they should solve 
>>> your initial confusion.
>>> 
>>> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
>>> I'm talking about Maybe.Just, of course. Just has always seemed strange to 
>>> me, as if it's hinting that it's something other than just the counterpart 
>>> to Nothing. I don't know the reasons behind its naming, but I think I would 
>>> prefer Something, as in "something or nothing". What do you think?
>>> 
>>> -- 
>>> 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/EHnuE_gGFuo/unsubscribe 
>>> .
>>> To unsubscribe from this group and all its topics, 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 a topic in the Google 
> Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/elm-discuss/EHnuE_gGFuo/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: Proposal: Shorter qualified imports

2016-11-21 Thread Jakub Hampl
I think the advantage of this is that it would encourage name-spacing 
rather than just publishing all modules as top level.

I think that too much namespacing is problematic 
(org.example.mypackage.data.hierarchy.Tree anyone?), but as the ecosystem 
grows, top-level module name clashes are bound to become more common.

On Monday, 21 November 2016 00:05:17 UTC, Max Goldstein wrote:
>
> It's tedious to write, and slightly tedious to read, but Elm thinks that 
> *tedium 
> is better than mystery* and anything implicit or shortcut-like would be 
> mysterious. Elm also doesn't like having multiple ways to do things.
>

-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Joey Eremondi
Honestly, these choices seem pretty arbitrary. Everyone has a preference.
ML uses Some/None, Haskell uses Just/Nothing. Some people find Something
intuitive, some don't.

Given that the choices is (mostly) arbitrary, it seems best to stick with
the status quo.

On Mon, Nov 21, 2016 at 7:47 AM, 'Andrew Radford' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> Probably inherited from Haskell, like a lot of other stuff. Doubt if there
> was any other thought put into it if I'm honest.
>
> On Monday, 21 November 2016 14:46:40 UTC, Will White wrote:
>>
>> Sorry, meant to say “I guess he’s already considered and rejected them”.
>>
>> On 21 Nov 2016, at 14:21, Will White  wrote:
>>
>> I prefer Some or None, for understanding. Though, unless Evan didn’t know
>> about them, I guess we’d already have them.
>>
>> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen 
>> wrote:
>>
>> How about 'Some' and 'None'?
>> Those are not longer to type than what we have today, and they should
>> solve your initial confusion.
>>
>> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
>>>
>>> I'm talking about Maybe.Just, of course. Just has always seemed strange
>>> to me, as if it's hinting that it's something other than just the
>>> counterpart to Nothing. I don't know the reasons behind its naming, but I
>>> think I would prefer Something, as in "something or nothing". What do you
>>> think?
>>>
>>
>> --
>> 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/to
>> pic/elm-discuss/EHnuE_gGFuo/unsubscribe.
>> To unsubscribe from this group and all its topics, 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] Unpublishing a package

2016-11-21 Thread 'Rupert Smith' via Elm Discuss
On Monday, November 21, 2016 at 2:39:21 PM UTC, Rupert Smith wrote:
>
> On Monday, November 21, 2016 at 11:42:30 AM UTC, Michel Rijnders wrote:
>>
>> The issue is that somebody forked our package (truqu/elm-base64) and 
>> published it, so now there's two (nearly) identical packages, potentially 
>> causing confusion.
>>
>
> I was recently wondering what would happen if someone did a fork then 
> publish. Why did they do it? was it to bump your package up for Elm 0.18? 
>

http://package.elm-lang.org/packages/MichaelCombs28/elm-mdl/latest 

elm-mdl has a fork which is upgraded for Elm 0.18, whereas the 'official' 
debois/elm-mdl has not been upgraded yet. Which is why I am wondering if 
this is happening because of the bump to 0.18. I guess people are not 
prepared to do it the nice way, which would be to ask the author(s) if they 
would accept help to bump to 0.18, do the work and make a pull-request, 
then politely but persistenly ask for the work to be published.

I'm still waiting on a few packages before I can move up to 0.18, but I 
would not take the approach of publishing forks.

-- 
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] Unpublishing a package

2016-11-21 Thread 'Rupert Smith' via Elm Discuss
On Monday, November 21, 2016 at 3:31:21 PM UTC, Max Goldstein wrote:
>
> I have a similar issue with my geojson library. I merged a PR but forgot 
> to run elm-package publish for a few days, and in the interim someone 
> published a fork. Reasonable, but now it's annoying.
>

I wonder if adding the ability to publish to a local repo would help? So by 
default 'elm-package publish' just pushes to your local cache, and then 
running 'elm-package install' would pull from there. There would be a 
different procedure to push to the package repo, perhaps something along 
the lines of 'elm-package publish --live-repo', which will then display a 
helpful message about not being too eager to publish forked packages and an 
are you sure y/N prompt.

That way someone being impatient for the PR to be published could at least 
make/publish/consume a local build in the interim.

-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread 'Andrew Radford' via Elm Discuss
Probably inherited from Haskell, like a lot of other stuff. Doubt if there 
was any other thought put into it if I'm honest.

On Monday, 21 November 2016 14:46:40 UTC, Will White wrote:
>
> Sorry, meant to say “I guess he’s already considered and rejected them”.
>
> On 21 Nov 2016, at 14:21, Will White > 
> wrote:
>
> I prefer Some or None, for understanding. Though, unless Evan didn’t know 
> about them, I guess we’d already have them.
>
> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen  > wrote:
>
> How about 'Some' and 'None'?
> Those are not longer to type than what we have today, and they should 
> solve your initial confusion.
>
> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
>>
>> I'm talking about Maybe.Just, of course. Just has always seemed strange 
>> to me, as if it's hinting that it's something other than just the 
>> counterpart to Nothing. I don't know the reasons behind its naming, but I 
>> think I would prefer Something, as in "something or nothing". What do you 
>> think?
>>
>
> -- 
> 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/EHnuE_gGFuo/unsubscribe.
> To unsubscribe from this group and all its topics, 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] Unpublishing a package

2016-11-21 Thread Max Goldstein
I have a similar issue with my geojson library. I merged a PR but forgot to 
run elm-package publish for a few days, and in the interim someone 
published a fork. Reasonable, but now it's annoying.

-- 
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] Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Will White
Sorry, meant to say “I guess he’s already considered and rejected them”.

> On 21 Nov 2016, at 14:21, Will White  wrote:
> 
> I prefer Some or None, for understanding. Though, unless Evan didn’t know 
> about them, I guess we’d already have them.
> 
>> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen > > wrote:
>> 
>> How about 'Some' and 'None'?
>> Those are not longer to type than what we have today, and they should solve 
>> your initial confusion.
>> 
>> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
>> I'm talking about Maybe.Just, of course. Just has always seemed strange to 
>> me, as if it's hinting that it's something other than just the counterpart 
>> to Nothing. I don't know the reasons behind its naming, but I think I would 
>> prefer Something, as in "something or nothing". What do you think?
>> 
>> -- 
>> 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/EHnuE_gGFuo/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] Unpublishing a package

2016-11-21 Thread 'Rupert Smith' via Elm Discuss
On Monday, November 21, 2016 at 11:42:30 AM UTC, Michel Rijnders wrote:
>
> The issue is that somebody forked our package (truqu/elm-base64) and 
> published it, so now there's two (nearly) identical packages, potentially 
> causing confusion.
>

I was recently wondering what would happen if someone did a fork then 
publish. Why did they do it? was it to bump your package up for Elm 0.18? 

-- 
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] Unpublishing a package

2016-11-21 Thread Peter Damoc
On Mon, Nov 21, 2016 at 1:42 PM, Michel Rijnders 
wrote:

> The issue is that somebody forked our package (truqu/elm-base64) and
> published it, so now there's two (nearly) identical packages, potentially
> causing confusion.
>

This is a more interesting issue to discuss.

On one side, there should be freedom to fork and improved/change a package
(as long as your license allows it).
On the other side, I would not want nearly identical packages creating
noise in the package manager.



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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: Can Javascript to start Elm app be attached per page?

2016-11-21 Thread Joel McCracken
Does your layout view load app.js *after* the body has been loaded, akin to 
how mine does it here? 
https://github.com/joelmccracken/ef_support/blob/master/web/templates/layout/app.html.eex

notice 

<%= render @view_module, @view_template, assigns %> 

comes before

">

If this is the case, the elm app code will not be defined by the time your 
view specific code is run.

LMK if this is what is going on. If this is the case, you should be seeing 
errors like "Elm is undefined".

On Sunday, November 20, 2016 at 6:31:15 PM UTC-5, Brian Marick wrote:
>
> Note: newbie to Javascript and frontend in general. 
>
> TL/DR: I would like to see an example of the Best Way to (1) have N urls 
> invoke N single-page Elm apps, and (2) pass each of them url-specific flags 
> (to be received by  `Html.App.programWithFlags`). 
>
> - 
>
> The Elixir/Phoenix book [1] suggests having a single “app.js” file, 
> compiled by Brunch. Part of the code compiled into that single file 
> contains specific tests of the form “Am I on the page where behavior X is 
> appropriate? If so, run this (page-specific) code to cause behavior X.” 
> Given that my code for X is written in Elm, the source for the Brunch 
> compilation contains code like this: 
>
> import Elm from './critter4us' 
>
> const ivDiv = document.querySelector('#iv-target'); 
> if (ivDiv) { 
> Elm.IV.embed(ivDiv); 
> } 
>
> const animalsDiv = document.querySelector('#animals-target'); 
> if (animalsDiv) { 
>  Elm.Animals.embed(animalsDiv, { 
> authToken: window.auth_token, 
> }); 
> } 
>
> // etc. 
>
> Note that the arguments are passed to Elm by cramming them into global 
> variables before the “app.js” file is loaded. That is: 
>
> window.auth_token = "<%= assigns[:auth_token] %>" 
> "> 
>
> --- 
>
> I can imagine having a whole sequence of such `if` tests in the master 
> javascript file, one for each Elm-enabled page. But that seems really 
> convoluted. It seems it would be better for each page to request a single 
> library (app.js, loaded from cache), then have a snippet of code that 
> launches the Elm app. 
>
> That is, following: 
>
> "> 
>
> would be a page-specific: 
>
>  
>   Elm.Animals.embed("#animals-target", { 
>   authToken: “fe9c6177-02df-4510-88fd-4c1bbe023d16", 
>   …} 
>  
>
> (Note: no need to cram values into `window`.) 
>
> But I can’t make that work. Can someone point me to examples? 
>
>
> ——— 
>
> [1] https://pragprog.com/book/phoenix/programming-phoenix

-- 
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: Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Will White
I prefer Some or None, for understanding. Though, unless Evan didn’t know about 
them, I guess we’d already have them.

> On 20 Nov 2016, at 23:41, Robin Heggelund Hansen  wrote:
> 
> How about 'Some' and 'None'?
> Those are not longer to type than what we have today, and they should solve 
> your initial confusion.
> 
> søndag 20. november 2016 18.16.26 UTC+1 skrev Will White følgende:
> I'm talking about Maybe.Just, of course. Just has always seemed strange to 
> me, as if it's hinting that it's something other than just the counterpart to 
> Nothing. I don't know the reasons behind its naming, but I think I would 
> prefer Something, as in "something or nothing". What do you think?
> 
> -- 
> 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/EHnuE_gGFuo/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: Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread Will White
I thought “something or nothing” would be really good for quick understanding. 
If Something is really too long, how about Thing (vs Nothing)? Or if noun 
phrases really matter, how about Have or Got?

> On 21 Nov 2016, at 13:12, 'Andrew Radford' via Elm Discuss 
>  wrote:
> 
> I dunno - I don't find either a clear winner over the other; years ago when I 
> came across 'Just' I was a little confused because it's not strictly the 
> opposite of 'nothing' when used in spoken English, it's normally used to also 
> express there is a limitation at work, in the presence of a greater 
> expectation. i.e it's a hungry man who says he has 'just peanuts' for lunch, 
> rather than 'some peanuts'
> On the other hand, 'Some' is kinda annoying cause it usually implies a 
> plurality ie 'Some Peanut' sounds wrong.
> 
> There are probably spoken languages out there that have the perfect words for 
> this concept. I'm not sure English is one of them.
> 
> 
> On Sunday, 20 November 2016 23:54:04 UTC, Daniel Walker wrote:
> `Just` seems the most natural to me. If I imagine myself explaining this to 
> someone: "So in this scenario, the thing is not nothing, it's just the thing."
> 
> 
> -- 
> 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/EHnuE_gGFuo/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: Rename Just to Something, as the counterpart to Nothing?

2016-11-21 Thread 'Andrew Radford' via Elm Discuss
I dunno - I don't find either a clear winner over the other; years ago when 
I came across 'Just' I was a little confused because it's not strictly the 
opposite of 'nothing' when used in spoken English, it's normally used to 
also express there is a limitation at work, in the presence of a greater 
expectation. i.e it's a hungry man who says he has 'just peanuts' for 
lunch, rather than 'some peanuts'
On the other hand, 'Some' is kinda annoying cause it usually implies a 
plurality ie 'Some Peanut' sounds wrong.

There are probably spoken languages out there that have the perfect words 
for this concept. I'm not sure English is one of them.


On Sunday, 20 November 2016 23:54:04 UTC, Daniel Walker wrote:
>
> `Just` seems the most natural to me. If I imagine myself explaining this 
> to someone: "So in this scenario, the thing is not nothing, it's just the 
> thing."
>
>>
>>

-- 
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] Unpublishing a package

2016-11-21 Thread Michel Rijnders
The issue is that somebody forked our package (truqu/elm-base64) and 
published it, so now there's two (nearly) identical packages, potentially 
causing confusion.

On Monday, November 21, 2016 at 12:17:33 PM UTC+1, Peter Damoc wrote:
>
> What is the actual issue here? What are you trying to solve? How would 
> unpublish make your life better? 
>
>
>
> On Mon, Nov 21, 2016 at 12:55 PM, Michel Rijnders  > wrote:
>
>> Hi,
>>
>> Is there a way to unpublish a package, i.e. to remove it from 
>> http://package.elm-lang.org/ ?
>>
>> Best,
>> Michel
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>

-- 
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] Unpublishing a package

2016-11-21 Thread Peter Damoc
What is the actual issue here? What are you trying to solve? How would
unpublish make your life better?



On Mon, Nov 21, 2016 at 12:55 PM, Michel Rijnders  wrote:

> Hi,
>
> Is there a way to unpublish a package, i.e. to remove it from
> http://package.elm-lang.org/ ?
>
> Best,
> Michel
>
> --
> 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.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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] Unpublishing a package

2016-11-21 Thread Michel Rijnders
Hi,

Is there a way to unpublish a package, i.e. to remove it 
from http://package.elm-lang.org/ ?

Best,
Michel

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