Re: [elm-discuss] Why aren't doc PRs merged?

2016-10-19 Thread Richard Feldman
Evan's elm-conf keynote may help clear up some of the "why" questions. :) https://www.youtube.com/watch?v=DSjbTC-hvqQ -- 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

[elm-discuss] hacktoberfest?

2016-10-19 Thread Gage Peterson
I would really like to get a free shirt for contributing for things. So tag your issues with #Hacktoberfest ! -- You received this message because

[elm-discuss] Re: why no more primes on 0.18 ?

2016-10-19 Thread Nathan Schultz
Primes I'll miss for convenience, like when naming an inner tail-recursion function to distinguish it from its wrapper. But it's not a big deal. As for back-ticks, I've never used them in Elm, but I use them in F# for defining human readable Unit Tests names. For example: []let ``Test that

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Francesco Orsenigo
Primes can be confusing even when doing pure maths (I studied physics), it's just so easy to miss them, so good riddance. When it comes to model names, I always try to 1) pipe my functions so that I need the least intermediate variable names and 2) use descriptive names no matter what; for

Re: [elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread Mike MacDonald
Leading commas are a good idea, since the first non-whitespace character of a line tells you if it is a continuation. On Wednesday, October 19, 2016 at 12:58:17 PM UTC-4, Peter Damoc wrote: > > On Wed, Oct 19, 2016 at 3:02 PM, John Orford > wrote: > >> Commas beginning

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread mbr
Naming sometimes can be hard. While I agree that model03 or model''' is a code smell. But often you are just transforming some data and the intermediate variables names are meaningless (besides reminding us that they are related) I've seen things like newModel being used everywhere and then

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Mark Hamburg
I use primes surprisingly often as well since if I have "newModel" then I probably also want "oldModel" rather than just "model" but I don't feel really strongly about it. I do, however, think that underscores would be worse than primes for API cases where the normal identifier isn't available

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Max Goldstein
Hey folks, this really should be on the dev list. That said I agree with most of what's been said here. The place I'll miss primes the most is actually the grammatical possessive: root'sValue, etc. But that's not a huge deal. -- You received this message because you are subscribed to the

Re: [elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread OvermindDL1
On Wednesday, October 19, 2016 at 10:58:17 AM UTC-6, Peter Damoc wrote: > > On Wed, Oct 19, 2016 at 3:02 PM, John Orford > wrote: > >> Commas beginning lines etc. >> >> Perhaps not idiomatic in Python or JS, but new good ideas rarely are : ) >> >> > I think I've answered too

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread OvermindDL1
On Wednesday, October 19, 2016 at 9:58:07 AM UTC-6, Rupert Smith wrote: > > On Wednesday, October 19, 2016 at 4:39:00 PM UTC+1, OvermindDL1 wrote: >> >> I've been using absinthe on the server side and I am able to control >> access permissions quite well for GraphQL hosting, though I am using a

[elm-discuss] Re: OT: Elm Style formatting for other languages?

2016-10-19 Thread Aislan de Sousa Maia
I've been using commas beginning lines in Javascript, but by my own hands : ) .. and my life is better now. ^-^ -- 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] How to write function that updates arbitrary element of a record

2016-10-19 Thread Nick H
This kind of problem (access to arbitrary elements) is usually better solved by a Dict than a record. In this case, you could try something like: type NumberText = FloatText String | IntText String type alias Model = Dict Key NumberText type Msg = UpdateField Key String update : Msg -> Model

Re: [elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread Peter Damoc
On Wed, Oct 19, 2016 at 3:02 PM, John Orford wrote: > Commas beginning lines etc. > > Perhaps not idiomatic in Python or JS, but new good ideas rarely are : ) > > I think I've answered too quickly in the previous reply. Commas beginning lines looks weird to a lot of

Re: [elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread Joey Eremondi
Haskell has hindent, which (now) follows the Elm philosophy of having a single style, not customizable. It's quite as nicely spread out as Elm, but it's at least close. On Wed, Oct 19, 2016 at 9:52 AM, Peter Damoc wrote: > On Wed, Oct 19, 2016 at 3:02 PM, John Orford

Re: [elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread Peter Damoc
On Wed, Oct 19, 2016 at 3:02 PM, John Orford wrote: > Perhaps not idiomatic in Python > Most formaters are also known as beautifiers and the Zen of Python starts with Beautiful is better than ugly. also, regarding the extra LOC Sparse is better than dense.

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Nick H
Oh no, sorry for being confusing. You are 100% correct. That was a reaction to myself having made such a silly mistake :-) On Wed, Oct 19, 2016 at 5:04 AM, Janis Voigtländer < janis.voigtlaen...@gmail.com> wrote: > Nick, can you elaborate on why you think that my statement that foo > `function`

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 4:39:00 PM UTC+1, OvermindDL1 wrote: > > I've been using absinthe on the server side and I am able to control > access permissions quite well for GraphQL hosting, though I am using a > custom permission library that ties to our local LDAP server so that code >

Re: [elm-discuss] How to write function that updates arbitrary element of a record

2016-10-19 Thread OvermindDL1
For note, if you are updating the view with the content, so if a person types "1w" then you do not store the update so it is still just "1" and you update the input with that so it becomes 1 as well, then a warning that sometimes the cursor jumps to the start when the user types fast. Not an

[elm-discuss] Re: OT: Elm Style formatting for other languages?

2016-10-19 Thread OvermindDL1
Not uncommon in many functional languages. I've seen it done in Haskell and OCaml as a couple of examples that pop straight to mind. On Wednesday, October 19, 2016 at 6:02:19 AM UTC-6, John Orford wrote: > > The standard elm code style is v nice - anyone know whether you can > /similar/

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread OvermindDL1
I've been using absinthe on the server side and I am able to control access permissions quite well for GraphQL hosting, though I am using a custom permission library that ties to our local LDAP server so that code would not be generically useful to release. But yes, I am a fan of GraphQL. I

Re: [elm-discuss] How to write function that updates arbitrary element of a record

2016-10-19 Thread Brian Marick
I see I left out a required argument from what I want, which leads me to this: update : Msg -> Model -> Model update msg model = case msg of ChangedDripText string -> updateWhen model isValidFloatString dripText string ChangedHoursText string ->

[elm-discuss] How to write function that updates arbitrary element of a record

2016-10-19 Thread Brian Marick
I have a model that looks like this: type alias Model = { ... , dripText : String , simulationHoursText : String , simulationMinutesText : String ... } Those strings each correspond to a text field containing floating point numbers. The whole thing looks

Re: [elm-discuss] Why aren't doc PRs merged?

2016-10-19 Thread Frederick Yankowski
Also, contributions to the Elm FAQ are welcome. It’s a community document hosted as an elm-community repo at GitHub . Most PRs to that repo are merged quickly as long as they don’t duplicate other material already

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Austin Bingham
Oops, it looks like I missed this before my last post. Sorry about that, and thanks for clearing up my confusion! On Wednesday, October 19, 2016 at 3:16:50 PM UTC+2, Rupert Smith wrote: > > On Wednesday, October 19, 2016 at 2:05:11 PM UTC+1, Rupert Smith wrote: >> >> On Wednesday, October 19,

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Austin Bingham
I think I have a pretty good grasp on Cmd.batch; as you say, it's pretty clear from the signature. Where I can't connect the dots is your notion of having my Task produce a batch of commands. As far as I know (and perhaps this is what I really need to know!), the only way to turn a Task into a

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 2:05:11 PM UTC+1, Rupert Smith wrote: > > On Wednesday, October 19, 2016 at 12:41:08 PM UTC+1, Austin Bingham wrote: >> >> I don't think I follow your logic. If my task produced a batch Cmd >> somehow (I'm not even sure how I would do that) >> > > You need to

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 12:41:08 PM UTC+1, Austin Bingham wrote: > > I don't think I follow your logic. If my task produced a batch Cmd somehow > (I'm not even sure how I would do that) > You need to figure out how to do that. Look at the type signature of Cmd.batch - hint, it returns

Re: [elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Austin Bingham
That's substantially cleaner than my initial approach, and initial indications are that it'll work (i.e. it definitely compiles, but I need to test it out later). Thanks! On Wednesday, October 19, 2016 at 2:03:13 PM UTC+2, Janis Voigtländer wrote: > > Why don’t you enrich your Msg type like so:

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Janis Voigtländer
Nick, can you elaborate on why you think that my statement that foo `function` bar corresponds to bar |> function foo rather than foo |> function bar is wrong? ​ 2016-10-19 9:55 GMT+02:00 Nick H : > N > > On Wed, Oct 19, 2016 at 12:34 AM, Janis Voigtländer < >

Re: [elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Janis Voigtländer
Why don’t you enrich your Msg type like so: type Msg = ... | Several (List Msg) and add a generic branch to your update function for processing a message of the Several kind (something in the spirit of: update (Several msgs) = List.foldr (... calling update recursively in an appropriate way ...)

[elm-discuss] OT: Elm Style formatting for other languages?

2016-10-19 Thread John Orford
The standard elm code style is v nice - anyone know whether you can /similar/ styles to use with auto-formatters for other languages? I.e. very spread out, with no aversion to adding to LOC counts : ) Commas beginning lines etc. Perhaps not idiomatic in Python or JS, but new good ideas rarely are

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Austin Bingham
Yes, my current approach does seem pretty solid from a theoretical point of view, but it feels like a poor expression of my intent. I have to create this "synthetic" intermediate msg which only exists for the purposes of the recursion, and then I have to handle the production of two messages in

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Austin Bingham
I don't think I follow your logic. If my task produced a batch Cmd somehow (I'm not even sure how I would do that), that would still get passed to my success handler in Task.perform. That handler has to produce a single msg (i.e. not a Cmd, so batching isn't involved) which is then used by

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 9:54:44 AM UTC+1, Peter Damoc wrote: > > *The problem * > > I know how to implement a REST API and interrogate that API from Elm but > that *seams very low level. * > > I was curious about a language abstraction that would isolate my Elm > program from the

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Simon
Sounds like you a recursively apply the update function, and that sounds like pretty solid functional programming On Wednesday, 19 October 2016 11:51:16 UTC+2, Austin Bingham wrote: > > Is there a way to make Task.perform produce a batched "Cmd msg" on success > (or failure, for that matter)?

[elm-discuss] Re: Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 10:51:16 AM UTC+1, Austin Bingham wrote: > > Is there a way to make Task.perform produce a batched "Cmd msg" on success > (or failure, for that matter)? I've got a case where, on success, I want to > send out more than one Msg, but because the success handler

Re: [elm-discuss] Metalinguistic abstractions over databases

2016-10-19 Thread Peter Damoc
GraphQL could be part of the answer. I would love to see an answer that includes GraphQL being explored. Ideally, I would love to see it explored in a more complex context where the data set is very large. e.g. some kind of application over the data from MusicBrainz. Let's say that I want to

Re: [elm-discuss] Metalinguistic abstractions over databases

2016-10-19 Thread John Orford
like graphql? On Wed, 19 Oct 2016 at 10:54 Peter Damoc wrote: > *The problem * > > I know how to implement a REST API and interrogate that API from Elm but > that *seams very low level. * > > I was curious about a language abstraction that would isolate my Elm > program from

[elm-discuss] Generating a batched Cmd of more than one msg from Task.perform

2016-10-19 Thread Austin Bingham
Is there a way to make Task.perform produce a batched "Cmd msg" on success (or failure, for that matter)? I've got a case where, on success, I want to send out more than one Msg, but because the success handler for Task.perform can only generate one msg this isn't straightforward. What I'm

[elm-discuss] Metalinguistic abstractions over databases

2016-10-19 Thread Peter Damoc
*The problem * I know how to implement a REST API and interrogate that API from Elm but that *seams very low level. * I was curious about a language abstraction that would isolate my Elm program from the actual database strategy. How do you approach dealing with the databases? What is your

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Nick H
N On Wed, Oct 19, 2016 at 12:34 AM, Janis Voigtländer < janis.voigtlaen...@gmail.com> wrote: > > 2016-10-19 9:27 GMT+02:00 Nick H : > >> The only situation where backticks are useful is when you are doing a >> single function call, and "foo `function` bar" is

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Janis Voigtländer
2016-10-19 9:27 GMT+02:00 Nick H : > The only situation where backticks are useful is when you are doing a > single function call, and "foo `function` bar" is easier to read than > "function > foo bar". I haven't seen this crop up too many times. But if it does, "foo >

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Nick H
Re: primes. Totally agree with Peter. One prime is kinda nice for a temporary variable, but beyond that... you can add a short word to your variable name, and then you won't have to do any counting! Re: backticks. Evan's explanation from elm-dev: The backtick syntax is neat, but ultimately, it

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Peter Damoc
Elm optimizes for learning and in doing so, encourages people to write clear code. I too had a brief love affair with primes after watching Leslie Lamport videos about TLA+ and discovering that they are allowed in Elm. I was encouraged to move away from them and favor a more explicit name like

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread John Orford
I am coming around to the make things as easy as possible for newbs approach. Elm is a big jump for people coming from JS, every little helps, including removing string syntax misinterpretations. Having said that, I suspect a total programming newcomer would find Elm right now easier than JS...

Re: [elm-discuss] why no more primes on 0.18 ?

2016-10-19 Thread Martin DeMello
Agreed; I'll definitely miss being able to use primes in variable names! martin On Tue, Oct 18, 2016 at 6:28 PM, mbr wrote: > just learned that primes and backticks won't be on elm 0.18. > > What are the reason for their removal? > > I will miss the primes quite a bit. Am