[elm-discuss] Should parsing code be integrated into Elm using port, managed effects, or native modules?

2016-11-22 Thread Wil C
I currently have a js library that will parse code and return either the html (render) or the AST (abstract syntax tree). The AST action per node is modifiable. I'd like use it in the following way: For a single node type in the AST, I want to process it (rather than just rendering it to Html)

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

2016-11-22 Thread Nick H
OK, here are the suggestions so far: type Maybe a = ... Nothing | Just a Nothing | Something a None | Some a NoValue | Some a Nothing | Some a Nothing | The a Nothing | A a Nothing | Thing a NoThing | Thing a Nothing | Have a Nothing | Got a Null | NotNull a No | Yes a Empty | Full a (I just

Re: [elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Austin Bingham
This article really opened my eyes to the possibilities of lenses and their interaction with the Return monad: https://toast.al/posts/2016-10-20-optical-swordplay-with-components.html Definitely worth a read. On Tue, Nov 22, 2016 at 8:17 PM Nick H wrote: > You might

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

2016-11-22 Thread David Andrews
I don't think it really works for this, but the natural definition for Maybe would seem to be Maybe a = Yes a | No On Nov 22, 2016 11:30 AM, "Will White" wrote: > I see. > > We’re happy using the ungrammatical Ok a for Results, so why not Thing a > for Maybes? > > On 22

Re: [elm-discuss] Re: Unpublishing a package

2016-11-22 Thread Martin DeMello
It's not a question of being antisocial or uncivilised; it's that it is really hard to say "I just want to patch this for 0.18 and continue using it in my project" without having globally visible effects. It is unreasonable to expect someone to wait for the package maintainer to do the update and

Re: [elm-discuss] Elm experience - proposal for additions to List and Random core libraries

2016-11-22 Thread Janis Voigtländer
Have you seen what is written at the following location? https://github.com/elm-lang/core/blob/master/CONTRIBUTING.md#adding-new-functions > Am 22.11.2016 um 17:21 schrieb Martin Cerny : > > Hi all, > I am currently about 3 side projects (small games) deep in Elm and the >

Re: [elm-discuss] Elm experience - proposal for additions to List and Random core libraries

2016-11-22 Thread Max Goldstein
I think List.get has been avoided since it seems imperative, and requires the use of Maybes. If you expect an item to be there, use a different data structure, or use an Array which has better time complexity. I agree completely on Random.constant. Random.permutation is available in

Re: [elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Nick H
> > You might look at lenses (e.g. elm-monocle) to see one approach that might > appeal to you. This is pretty cool. I've often made setter functions for my records, wrapping around Elm's regular update syntax. I didn't realize that it's part of a larger class of patterns. On Tue, Nov 22, 2016

[elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Rex van der Spuy
Thanks so much for explaining that. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit

Re: [elm-discuss] Elm experience - proposal for additions to List and Random core libraries

2016-11-22 Thread Martin Cerny
And I thought I have found and read all the relevant documents before posting :-) Thanks, that makes total sense. Martin On Tuesday, 22 November 2016 17:33:45 UTC+1, Janis Voigtländer wrote: > > Particularly the last two paragraphs. > > Am 22.11.2016 um 17:32 schrieb Janis Voigtländer

Re: [elm-discuss] Elm experience - proposal for additions to List and Random core libraries

2016-11-22 Thread Janis Voigtländer
Particularly the last two paragraphs. > Am 22.11.2016 um 17:32 schrieb Janis Voigtländer > : > > Have you seen what is written at the following location? > > https://github.com/elm-lang/core/blob/master/CONTRIBUTING.md#adding-new-functions > > >> Am 22.11.2016

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

2016-11-22 Thread Will White
I see. We’re happy using the ungrammatical Ok a for Results, so why not Thing a for Maybes? > On 22 Nov 2016, at 13:06, 'Andrew Radford' via Elm Discuss > wrote: > > I think his point was if it was a Maybe List Int, then you would have > > 'A items' > > It

[elm-discuss] Elm experience - proposal for additions to List and Random core libraries

2016-11-22 Thread Martin Cerny
Hi all, I am currently about 3 side projects (small games) deep in Elm and the experience has been overally very good. I however encountered a few simple things I missed in the core libraries, so I would like to ask, if there is a reason to not have them there. If not, I'll be happy to file a

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

2016-11-22 Thread Juan Soto
I'd stick to JavaScript. It'll help them get jobs, it's what they'll use at work, and will equip them the best for doing their own projects (particularly Node). A semester is a lot shorter than you think, but you can mention Elm at the end if you want. I honestly see no benefit of teaching it

Re: [elm-discuss] Can Javascript to start Elm app be attached per page?

2016-11-22 Thread OvermindDL1
Awesome, you should post that in the elm section of the ElixirForums too so both sides can see it! :-) On Monday, November 21, 2016 at 5:52:59 PM UTC-7, Brian Marick wrote: > > I figured out how to make it work, thanks to your help. Because there are > some fiddly bits, I wrote up a blog post

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

2016-11-22 Thread OvermindDL1
I teach languages but not web programming specifically. I'd might recommend Elixir as a good back-end server software to program in. It is easily one of the language that are the most fun to program in, although it is not statically typed, it is fully functional. I happen to use Elixir on

Re: [elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Austin Bingham
You might look at lenses (e.g. elm-monocle) to see one approach that might appeal to you. Lenses are apparently frowned upon by some, but I think they capture the essence of what you're asking. On Tue, Nov 22, 2016 at 4:04 PM Wouter In t Velt wrote: > Op dinsdag 22

[elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Wouter In t Velt
Op dinsdag 22 november 2016 15:55:25 UTC+1 schreef Rex van der Spuy: > > But, can anyone explain why Elm doesn't let us do this? > My impression is that it has to do with the enforced strong typing and type safety of elm. A record is intended for key-value type info where each value could be of

Re: [elm-discuss] Proposed addition for Task package

2016-11-22 Thread Charlie Koster
> > The log then shows that between the DoStuff message and the DoMore > message, a Tick message comes in. > Well, that's troubling and undermines my assumption. That's for looking into this. For those skimming through this post, *race conditions are possible when doing something like

Re: [elm-discuss] Can't install native package using elm-github-install

2016-11-22 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, November 22, 2016 at 4:59:22 AM UTC, Gusztáv Szikszai wrote: > > 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

Re: [elm-discuss] Proposed addition for Task package

2016-11-22 Thread Wouter In t Velt
For those interested: here is the example I refered to: import Html exposing (..) import Html.Events exposing (onClick) import Time exposing (Time, second) import Task main = Html.program { init = init , view = view , update = update , subscriptions = subscriptions } --

[elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Rex van der Spuy
Thanks for all your replies everyone!! I'm glad to have confirmation that this really is impossible and it's not just me. I think for now I'm just going to leave it as is. It's nice and simple and I understand it :) But, can anyone explain why Elm doesn't let us do this? -- You received this

Re: [elm-discuss] Proposed addition for Task package

2016-11-22 Thread Wouter In t Velt
Op dinsdag 22 november 2016 14:49:47 UTC+1 schreef Charlie Koster: > > My assumption is a race condition here wouldn't be possible since calling > `sendMsg MyMsg` is a synchronous action > I have tried it out in elm-lang.org/try, which suggests that it is asynchronous, in a simple setup -

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

2016-11-22 Thread Robin Heggelund Hansen
'A itemList' ;-) tirsdag 22. november 2016 14.06.17 UTC+1 skrev Andrew Radford følgende: > > I think his point was if it was a Maybe List Int, then you would have > > 'A items' > > It still seems English is not up to this task :) We should probably just > make up a new word, start using it day

Re: [elm-discuss] Proposed addition for Task package

2016-11-22 Thread Charlie Koster
> but I have seen terrible bugs being introduced by improper use, caused by > Cmd messages being created based on model state A, and because of race > conditions (e.g. fetch results coming in in the meantime) > My assumption is a race condition here wouldn't be possible since calling

Re: [elm-discuss] Proposed addition for Task package

2016-11-22 Thread Wouter In t Velt
Op dinsdag 22 november 2016 13:47:55 UTC+1 schreef Charlie Koster: > > I respectfully disagree. Depending on the application, this either may not > be possible or would be a terrible code smell. I honestly think the above > suggestion would be worse than chaining another Cmd msg. Sending another

[elm-discuss] Re: Status of Elm drag-and-drop with html elements

2016-11-22 Thread Simon
Is DragNDrop still something that needs ot be implemented with Mouse. There seems to be so much support for dragging built into Html directly that we ought to be able to do things more directly in Em by now I would have thought? On Wednesday, 7 September 2016 20:19:25 UTC+2, Ivan Uemlianin

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

2016-11-22 Thread 'Andrew Radford' via Elm Discuss
I think his point was if it was a Maybe List Int, then you would have 'A items' It still seems English is not up to this task :) We should probably just make up a new word, start using it day to day, then have it included in the OED. If it can be done for 'selfie

Re: [elm-discuss] Proposed addition for Task package

2016-11-22 Thread Charlie Koster
> > One reason is what Evan says at > https://github.com/elm-lang/core/blob/master/CONTRIBUTING.md#adding-new-functions: > > new functions are not so quickly expected to go into core, instead to be > accumulated in *-extra packages first. > I didn't realize that was the case. Thanks for the

Re: [elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Wouter In t Velt
PS: the function definition should not be capitalized, but should be called "animateProperty" of course -- 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

Re: [elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Wouter In t Velt
There is a way to make it work, but it will be a lot more verbose/ ugly/ overengineered. Your signature would need to look something like this: AnimateProperty : Model -> (Model -> Style) -> (Style -> Model -> Model) -> Msg -> (Model, Msg) AnimateProperty = model funcToExtractStyle

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

2016-11-22 Thread Tim Bezhashvyly
Yay, it works. Thank you for teaching me this pattern Thomas! On Tuesday, November 22, 2016 at 12:22:01 PM UTC+1, Thomas Coopman wrote: > > If you have a function: compare : Date -> Foo -> Bool > you can then do: compareWithDate = compare date > and in your filter use compareWithDate: > > compare

Re: [elm-discuss] Re: Unpublishing a package

2016-11-22 Thread Peter Damoc
On Tue, Nov 22, 2016 at 1:12 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > What about the issue of people forking and re-publishing packages (and > ignoring the tests), because they are too impatient/anti-social to go about > things in more civilized manner? Do there

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

2016-11-22 Thread Thomas Coopman
If you have a function: compare : Date -> Foo -> Bool you can then do: compareWithDate = compare date and in your filter use compareWithDate: compare : Date -> Foo -> Bool compare . filterFoos : List Foo -> Date -> List Foo filterFoos foos date = let compareWithDate = compare date

Re: [elm-discuss] Re: Passing properties as arguments to messages?

2016-11-22 Thread Thomas Coopman
You can also extract getting the model property in a separate function, so that you don't have to duplicate it completely. On Mon, 21 Nov 2016 at 23:59 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > On Monday, November 21, 2016 at 6:27:40 PM UTC, Rex van der Spuy wrote:

[elm-discuss] Re: Unpublishing a package

2016-11-22 Thread 'Rupert Smith' via Elm Discuss
What about the issue of people forking and re-publishing packages (and ignoring the tests), because they are too impatient/anti-social to go about things in more civilized manner? Do there need to be stricter controls for getting stuff into the repo? Do we need or can we manage some kind of

Re: [elm-discuss] Can't install native package using elm-github-install

2016-11-22 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, November 22, 2016 at 10:32:22 AM UTC, Gusztáv Szikszai wrote: > > Yes, that is perfect for my use case, thanks. This should be added to the >> official packages? >> > > This kind of messaging is not encouraged (sending things around the > program), so It probably will not be added

Re: [elm-discuss] Proposed addition for Task package

2016-11-22 Thread Wouter In t Velt
My 2c: I kind of like it that there is NOT such a function in the core. Because it *prevents me from grabbing it when I really shouldn't*. Especially if the `Cmd` has no side effects, it is better to do a recursive call to the `update` function, or better yet: call the function that your

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

2016-11-22 Thread Will White
type Maybe thing = A thing | Nothing So with List.head list I’d get A 2 or Nothing. > On 22 Nov 2016, at 10:20, Oliver Searle-Barnes wrote: > > The problem with Some is that it should be A/An/Some depending on the > subject. I'm starting to come round to Thing vs Nothing.

[elm-discuss] Tag new releases in the elm platform repo

2016-11-22 Thread futtetennista
I recently contributed to the docker-elm repo and in order to build an image for a given elm version the BuildFromSourceFile.hs file is needed . I think it'd be nicer, more explicit

Re: [elm-discuss] Can't install native package using elm-github-install

2016-11-22 Thread Gusztáv Szikszai
> > Yes, that is perfect for my use case, thanks. This should be added to the > official packages? > This kind of messaging is not encouraged (sending things around the program), so It probably will not be added to the official packages. That is, I provide the name of the channel and it

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

2016-11-22 Thread Oliver Searle-Barnes
The problem with Some is that it should be A/An/Some depending on the subject. I'm starting to come round to Thing vs Nothing. While the grammer isn't spot on the semantics are very clear. On Tuesday, 22 November 2016 11:06:10 UTC+1, Will White wrote: > > weapon = Just sword doesn’t make sense

Re: [elm-discuss] Can't install native package using elm-github-install

2016-11-22 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, November 22, 2016 at 4:59:22 AM UTC, Gusztáv Szikszai wrote: > > 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

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

2016-11-22 Thread Will White
weapon = Just sword doesn’t make sense for Maybe. It implies “just sword, out of all the weapons”. Just would make sense in a Just weapon | All (List weapon) type, where weapon could also be All [ sword, mace, nunchuk ]. I think we all agree that Nothing totally nails its concept (better than

Re: [elm-discuss] Unpublishing a package

2016-11-22 Thread Peter Damoc
On Tue, Nov 22, 2016 at 10:42 AM, Michel Rijnders wrote: > That's too simplistic, you can also break lots of projects by publishing a > version of a package with a serious bug. And what if it's a security bug > that somehow exposes sensitive information? In such a

Re: [elm-discuss] Unpublishing a package

2016-11-22 Thread Michel Rijnders
On Tuesday, November 22, 2016 at 12:33:40 AM UTC+1, Richard Feldman wrote: > > There is no unpublish feature, and it's important that there never be one > . :) > That's too simplistic, you can also break lots of projects by publishing