[elm-discuss] Re: Pre-requisites for learning Elm?

2016-10-25 Thread Fergus Meiklejohn
I think understanding CCS and HTML are pretty essential to applying Elm to practical projects in the browser. But that's just saying, "if we want to make things in the browser we need to know CSS"; it doesn't really have much to do with Elm the language. Similarly, Javascript is very useful

[elm-discuss] Re: zip function in the standard library

2016-10-25 Thread janderson
I agree with Luis and Gulshan. Having a "zip" function without a corresponding "unzip" reduces the readability and intuitive discoverability of the language. This is my Python sensibilities talking, I know. Python also haze "zip" and I thought it also had "unzip". But when I tried it, I

[elm-discuss] Re: Is there any way to use a type instead of a string for the value of an option

2016-10-25 Thread Ian Mackenzie
I've been slowly working on a small library to make working with the basic input widgets like more pleasant to work with - I'd be interested to see what you think. The implementation

[elm-discuss] Re: Function equality again

2016-10-25 Thread Mark Hamburg
Okay. I'm shutting up here and just tacking this onto https://github.com/elm-lang/elm-compiler/issues/1145. On Tue, Oct 25, 2016 at 4:15 PM, Mark Hamburg wrote: > Here is a very simple failure case that shows that comparing tasks isn't > necessarily safe (though it does

[elm-discuss] Re: Function equality again

2016-10-25 Thread Mark Hamburg
Here is a very simple failure case that shows that comparing tasks isn't necessarily safe (though it does succeed if I create two success tasks): import Html exposing (..) import Http task1 = Http.getString "http://somewhere; task2 = Http.getString "http://somewhere; main = text <| if task1

[elm-discuss] Function equality again

2016-10-25 Thread Mark Hamburg
I just thought of another example where the ability to test function equality matters: Picking up on a discussion on elm-dev regarding the new HTTP rate limiting logic, I thought about moving my case away from using rate limit and instead just creating the model code to manage buffering HTTP

Re: [elm-discuss] tictactoe game with elm (newbie)

2016-10-25 Thread Peter Damoc
On Tue, Oct 25, 2016 at 11:12 PM, Did wrote: > Now is the hardest part for me : the update function. Since elm is a > functional language, I suppose I have to recreate a new cells list with the > value of the box concerned by the click. In OOP languages, I'd just take >

Re: [elm-discuss] tictactoe game with elm (newbie)

2016-10-25 Thread Did
Ok so now I have moved my area (which I renamed cells) into the model : type alias Model = { player1: Player ,player2: Player ,current: Player ,boxClicked: Maybe Int ,cells: List (List Box) } I initialize the cells like this : cells: List (List Box)

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread Juan Soto
I'm an observer (not an Elm programmer) but these discussions are interesting to me. I guess the question Elm programmers have to ask themselves is what Elm's purpose is? Haskell/traditional Functional ML language in the browser? PureScript fits that mold already, but if so the recent changes

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread Robin Heggelund Hansen
Once, that I remember, after a refactoring. But this is more to do with the ease of reading code. I've several times seen foldr and read foldl. In general, I find names that differ by only a single letter a bad thing. Like wether and whether. Sure, now that i've pointed out that there is a

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 1:45:35 PM UTC+1, James Hamilton wrote: > > I agree with your sentiment in principle. I suppose the underlying >> question is whether or not this is actually going to be such a benefit to >> future users of elm that it would be worth inconveniencing current users

[elm-discuss] Re: D3 4.0 or D3-shape

2016-10-25 Thread Jakub Hampl
I'm the author of the aforementioned library. Arc generators happen to be next on my roadmap, which you can see on https://github.com/gampleman/elm-visualization/projects/1. I've marked things that should be reasonably easy contributions there as well :) -- You received this message because

[elm-discuss] Re: Is there any way to use a type instead of a string for the value of an option

2016-10-25 Thread OvermindDL1
`option` is supposed to match to the html , thus only strings, any marshalling you will need to perform yourself, such as by, for example, wrapping up option into something like `optionMyType t = option [ value (myTypeSerialize t) ]` or so for ease of use. :-) On Tuesday, October 25, 2016 at

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread Kasey Speakman
So to phrase what I previously said a different way, a database is the wrong level of abstraction to be shooting for. A database is just one integration that most business systems have. The system itself exposes use cases and queries. Whether and which databases are involved (and their

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread Robin Heggelund Hansen
I did a lot of work in ember myself, and I feel your pain, but this is still a 0.x product, and so it should be expected that some breakage is performed while we reach the best possible state of the language. It's different for Ember, which had a lot of breakage post 1.0. tirsdag 25. oktober

[elm-discuss] Re: IntelliJ (WebStorm) devs, how do you read the compiler errors?

2016-10-25 Thread Birowsky
Thanx to you guys, I'm so close to what I wanted to do. I have summed up my findings here: http://stackoverflow.com/q/40240254/592641 Hop on if you have an idea! Carlos, sorry, i'm not sure what are you doing inside ESLint : ) please elaborate your discoveries. -- You received this message

[elm-discuss] Is there any way to use a type instead of a string for the value of an option

2016-10-25 Thread James Hamilton
Hello! I suppose this really only applies to instances of , but there may be other examples. When using with , it's necessary to set a value on the using which accepts a String. However, I usually actually want to refer to a Type which I have to represent as a String and marshal it back

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread James Hamilton
> > I agree with your sentiment in principle. I suppose the underlying > question is whether or not this is actually going to be such a benefit to > future users of elm that it would be worth inconveniencing current users > who want to upgrade. Personally I'm quite comfortable with foldr and

Re: [elm-discuss] tictactoe game with elm (newbie)

2016-10-25 Thread Peter Damoc
On Tue, Oct 25, 2016 at 2:57 PM, Did wrote: > Thanks Peter for your help! I could go further but now, there's another > issue. I would like to display the current player's shape when he clicks on > a cell. The thing is I don't know how to interact with the DOM in this >

Re: [elm-discuss] tictactoe game with elm (newbie)

2016-10-25 Thread Did
Thanks Peter for your help! I could go further but now, there's another issue. I would like to display the current player's shape when he clicks on a cell. The thing is I don't know how to interact with the DOM in this case. I know how to define an onClick event on each cell (displayed as a

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread 'Andrew Radford' via Elm Discuss
As people pointed out - it's a BDFL call, but it feels to me that this is the closest candidate to the spirit of the recent 'Let's go mainstream' BDFL calls. (Assuming that foldRight is sufficiently less commonly used so as to not make the ample suffix 'Right' burdensome, and the lack of

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 10:01:48 AM UTC+1, Peter Damoc wrote: > > On Tue, Oct 25, 2016 at 11:27 AM, 'Rupert Smith' via Elm Discuss < > elm-d...@googlegroups.com > wrote: > >> If your 'persistence API' requires the application to behave correctly in >> order to not store invalid or

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread Robin Heggelund Hansen
fold and foldRight then? tirsdag 25. oktober 2016 11.42.00 UTC+2 skrev Wouter In t Velt følgende: > > Op dinsdag 25 oktober 2016 02:20:29 UTC+2 schreef Max Goldstein: >> >> Changing things makes upgrading harder, invalidates old code, and gives >> the larger community the impression that Elm is

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread Wouter In t Velt
Op dinsdag 25 oktober 2016 02:20:29 UTC+2 schreef Max Goldstein: > > Changing things makes upgrading harder, invalidates old code, and gives > the larger community the impression that Elm is not stable. > The question is whether different naming for "foldl" and "foldr" would bring enough

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread Peter Damoc
On Tue, Oct 25, 2016 at 11:27 AM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > If your 'persistence API' requires the application to behave correctly in > order to not store invalid or maliciously altered data, you cannot > guarantee that. > This actually sounds more

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 9:27:58 AM UTC+1, Rupert Smith wrote: > > On Tuesday, October 25, 2016 at 8:08:11 AM UTC+1, Peter Damoc wrote: >> >> Browsers can provide a trusted environment through the use of https. This >> is what Gmail and Facebook and all other webapps are doing. >> > >

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 8:08:11 AM UTC+1, Peter Damoc wrote: > > Why not just freeze dry your entire application state to some key/value >> store (on every update), then you have a simple way to rehydrate the whole >> application after a period of inactivity? >> > > This is not an option

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 25, 2016 at 8:08:11 AM UTC+1, Peter Damoc wrote: > > Browsers can provide a trusted environment through the use of https. This > is what Gmail and Facebook and all other webapps are doing. > What I mean is, there is nothing to stop whoever is running your application from

Re: [elm-discuss] Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-25 Thread Peter Damoc
On Tue, Oct 25, 2016 at 3:20 AM, Max Goldstein wrote: > It really comes down to what Evan wants to do. People come to Elm from > many languages, and everyone has preferences. Changing things makes > upgrading harder, invalidates old code, and gives the larger community

Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-25 Thread Peter Damoc
On Tue, Oct 25, 2016 at 2:06 AM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > I think the model that has the lowest 'cognitive overload' for a beginner > is to simply work with the request/response model of HTTP, and to request > data when needed, and POST data when you