[elm-discuss] Re: Do the same with ELM?

2016-10-20 Thread António Ramos
http://blog.krawaller.se/posts/composition-in-cyclejs-choo-react-and-angular2/ 2016-10-20 11:48 GMT+01:00 António Ramos : > can anyone dare to code the same app in elm? > http://blog.krawaller.se/posts/composition-in-cyclejs- > choo-react-and-angular2/~ > i would like to

[elm-discuss] Do the same with ELM?

2016-10-20 Thread António Ramos
can anyone dare to code the same app in elm? http://blog.krawaller.se/posts/composition-in-cyclejs-choo-react-and-angular2/~ i would like to see it and learn from you guys because i just "hate" javascript... Regards António -- You received this message because you are subscribed to the Google

[elm-discuss] JSComp with elm

2016-10-20 Thread António Ramos
http://blog.krawaller.se/jscomp/index.html I see that elm has a lot more code than the others to do the same tasks. regards -- 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

[elm-discuss] Re: Atom Editor Race Condition (elm-format on save)

2016-10-20 Thread halohalospecial
Hi! After invoking the "save" command, `linter-elm-make` will execute the elm-make process behind the scenes (the specific event in Atom is `onDidSave`). AFAIK, `atom-beautify` is also waiting for the `onDidSave` event. It now depends on which of these 2 packages will handle that event

Re: [elm-discuss] Re: Atom Editor Race Condition (elm-format on save)

2016-10-20 Thread Duane Johnson
Thanks for the explanation and suggestion! I have `elm-format` (the atom package) installed now. On Thu, Oct 20, 2016 at 4:11 AM, halohalospecial wrote: > Hi! > > After invoking the "save" command, `linter-elm-make` will execute the > elm-make process behind the

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-20 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 19, 2016 at 8:23:46 PM UTC+1, OvermindDL1 wrote: > > Absinthe handles all the nasty parts of GraphQL though, the combining of > queries, the real-time type documentation generation, etc... etc... > What database do you use? Is it always a SQL database or can Absinthe work

[elm-discuss] Re-position element once its dimension is known

2016-10-20 Thread Jacky See
I'm doing some dropdown UI where I would like to re-calculate position of the element once it appeared on screen. Something like http://github.hubspot.com/drop/docs/welcome/ While I can get the triggering element position on click, I'm thinking how should get the offsetWidth/offsetHeight of the

[elm-discuss] Atom Editor Race Condition (elm-format on save)

2016-10-20 Thread Duane Johnson
I have my Atom Editor configured with the following plugins: - atom-beautify - language-elm - linter - linter-elm-make The atom-beautify plugin is configured to "Beautify On Save". Normally, after I save an elm file, they elm-format step is triggered, and the linter tells me if there are any

Re: [elm-discuss] How to model a transient state?

2016-10-20 Thread Jacky See
My current approach is to have a `readStateToBe` which contains the pending update state. and 'flush update' (write `readStateToBe` to `readState`) on appropriate update branch (e.g. switching filter). -- You received this message because you are subscribed to the Google Groups "Elm Discuss"

[elm-discuss] Re: Atom Editor Race Condition (elm-format on save)

2016-10-20 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 20, 2016 at 9:39:44 AM UTC+1, Duane Johnson wrote: > > I have my Atom Editor configured with the following plugins: > - atom-beautify > - language-elm > - linter > - linter-elm-make > > The atom-beautify plugin is configured to "Beautify On Save". Normally, > after I save an

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

2016-10-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 18, 2016 at 11:17:41 PM UTC+1, Shump wrote: > > I believe there already is a "community edition" over at > https://www.elm-tutorial.org/en/ Does anybody know if pull requests are being incorporated for elm-lang.org? In particular, as a newbie I have noticed that the syntax

Re: [elm-discuss] Re: Do the same with ELM?

2016-10-20 Thread António Ramos
As a side note we need "elmbin" to share and collect stuff like we do with https://jsbin.com for example.. 2016-10-20 13:57 GMT+01:00 Erkal Selman : > You can paste the following into http://elm-lang.org/try : > > > *import Html exposing (text, div, input, button, p,

Re: [elm-discuss] Re: Do the same with ELM?

2016-10-20 Thread António Ramos
I´m so in love with ELM, @Erkal please submit this code to http://blog.krawaller.se/jscomp/pages/composition.html Thank you 2016-10-20 14:56 GMT+01:00 Erkal Selman : > Thanks Marco, here is the corrected version: > > *import Html exposing (text, div, input, button, p,

[elm-discuss] Re: Do the same with ELM?

2016-10-20 Thread Erkal Selman
You can paste the following into http://elm-lang.org/try : *import Html exposing (text, div, input, button, p, span)* *import Html.App exposing (beginnerProgram)* *import Html.Attributes exposing (..)* *import Html.Events exposing (onInput, onClick)* *main =* *beginnerProgram* *{

[elm-discuss] Re: Do the same with ELM?

2016-10-20 Thread Marco Perone
you could just add a `value` to your input field like input [ onInput NewContent, value inputStr ] and then reset the `inputStr` value when you confirm the submission Confirm -> { model | state = WaitingForSubmit , inputStr = ""

Re: [elm-discuss] Re: Re-position element once its dimension is known

2016-10-20 Thread Jacky
You still need to do edge detection. e.g. the dropdown is originally displayed below the button, when the button is near the page bottom, the dropdown need to be above instead. On Thu, Oct 20, 2016 at 9:04 PM, Erkal Selman wrote: > Instead of getting the position, why not

[elm-discuss] Re: Do the same with ELM?

2016-10-20 Thread Erkal Selman
Thanks Marco, here is the corrected version: *import Html exposing (text, div, input, button, p, span)* *import Html.App exposing (beginnerProgram)* *import Html.Attributes exposing (..)* *import Html.Events exposing (onInput, onClick)* *main =* *beginnerProgram* *{ model = { state

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

2016-10-20 Thread Robin Heggelund Hansen
In Elm 0.18, primes are being removed as valid characters in a variable/function name. The reason being, which I whole heartedly agree with, that removing primes will incentivize people to write proper names, and also because the difference between model and model' isn't always easy to spot.

Re: [elm-discuss] Proposal: Rename case..of -> match..with

2016-10-20 Thread António Ramos
I´m a "no Elm experience people" and i dont like "match with". to type "case of" i need 6 keystrokes(without spaces) to type "match with" i need 9 . i would prefer to remove the "of" and just leave it as "case ?!? ->" instead of "case ?!? of ->" Regards to whomever lives to type less and love

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

2016-10-20 Thread Max Goldstein
Normally I'm opposed to syntax or name changes. But I think this or some variation is a good idea. (Maybe foldl becomes fold, since it's usually the one you want.) That said, it's all subject to Evan's approval. -- You received this message because you are subscribed to the Google Groups

[elm-discuss] Re: ports and reserved words

2016-10-20 Thread Frederick Yankowski
I had a similar problem with a field named `default`. I think you have to avoid all Javascript reserved words for records passed through ports. http://www.w3schools.com/js/js_reserved.asp It is an unfortunate leak of Javascript constraints into the Elm world. It does seem that the compiler

[elm-discuss] React for Elm programmers

2016-10-20 Thread Thomas Ballinger
Nothing came up from a cursory Google search, does anyone know of or have interest in a resource like "React for Elm Programmers?" I've just done a few Elm projects, but now as I explore the React ecosystem I'm wishing I had access to explanations in terms of Elm concepts I'm more familiar

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

2016-10-20 Thread Ambrose Laing
One could define fold as a generic operation that replaces the empty list with a constant (for example an identity element) and replaces the "cons" operator with a function that takes an element and a partial result. This is consistent with other ways to define generalized folds over recursive

Re: [elm-discuss] Proposal: Rename case..of -> match..with

2016-10-20 Thread Joey Eremondi
There's precedence in both directions, case comes from Haskell. So changing it doesn't necessarily mean we'll match everyone else, pardon the pun. Being easier for non native English speakers seems pretty subjective, some people might find case more intuitive as non native speakers. To me, case

[elm-discuss] Re: Demo project that fails Google Closure Advanced Optimizations

2016-10-20 Thread OvermindDL1
I know it fails on our large Elm project at work, we have to run with standard optimizations of the Google Closure compiler, but I did not research in to far since generated code is not code that I control and I needed to get things done. If I get time I'll try to run it again and get some

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

2016-10-20 Thread Robin Heggelund Hansen
Please stay on topic. This thread is strictly about the naming of foldl and foldr, nothing else. torsdag 20. oktober 2016 19.24.47 UTC+2 skrev Ambrose Laing følgende: > > One could define fold as a generic operation that replaces the empty list > with a constant (for example an identity

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

2016-10-20 Thread Martin DeMello
I would be strongly opposed to renaming either foldl or foldr to just fold; that always confuses me when languages do it. martin On Thu, Oct 20, 2016 at 8:32 AM, Max Goldstein wrote: > Normally I'm opposed to syntax or name changes. But I think this or some > variation

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-20 Thread John Kelly
I'm sorry to link drop, but I've been doing a bit of work on a library to remove some of the boilerplate when writing client code for a REST API. The library is currently locked in / specific to what is called PostgREST, but I imagine that the patterns could be applied to any REST backend.

[elm-discuss] elm-testable versus testing a lower-level function

2016-10-20 Thread Andrew Bruce
I'm new to Elm, and have been playing with test methodologies. I'm wondering what the arguments for using elm-testable are, as opposed to testing something that returned a `(Model, Maybe Cmd)`, for example. I've dodged using elm-testable by having a

Re: [elm-discuss] Proposal: Rename case..of -> match..with

2016-10-20 Thread Kasey Speakman
But `case` is a pattern matcher. Check out how it is used here in lieu of a parser. https://github.com/knewter/time-tracker/blob/master/elm/src/Route.elm#L91 On Thursday, October 20, 2016 at 11:16:49 AM UTC-5, Joey Eremondi wrote: > > There's precedence in both directions, case comes from

[elm-discuss] Re: Demo project that fails Google Closure Advanced Optimizations

2016-10-20 Thread Robin Heggelund Hansen
If you get the chance, try to change the generated code from the elm compiler and change statements that performs a `'ctor' in obj` tests. Change them to `typeof obj.ctor === 'undefined'` or some such. There is one in the eqHelp function (called by `=`) and one in the toString function. The

Re: [elm-discuss] Structure for large Elm apps

2016-10-20 Thread clouddie
Actually, just to testify on nested components : got severely burnt by this pattern as I spent my Sunday refactoring my app before discovering that one nested component had to update the state of an other one, and realized I just did not want to go through the whole sibling or child whatever

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

2016-10-20 Thread Francesco Orsenigo
Can't you just create a smaller component that does the validation on itself, and then compose several of them into a list/dictionary? componentUpdate : (String -> Bool) -> Msg -> String componentUpdate hasError msg oldString = case UserEntersSomething newString if hasError newString then

Re: [elm-discuss] How to model a transient state?

2016-10-20 Thread Nick H
What if you added a third value to the ReadState type? type ReadState = Read | Unread | Marked Then your filtered view will show both Unread and Marked. When the user refreshes, you can map all the Marked items to Read. On Thu, Oct 20, 2016 at 12:43 AM, Jacky See wrote: >

Re: [elm-discuss] How to model a transient state?

2016-10-20 Thread Jacky
Thanks! "Marked" is clearer and reflect what's happening on the screen. On Fri, Oct 21, 2016 at 3:55 AM, Nick H wrote: > What if you added a third value to the ReadState type? > > type ReadState = Read | Unread | Marked > > Then your filtered view will show both

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-20 Thread Kasey Speakman
I like to put databases behind APIs. But I don't map URIs directly to database entities. I map URIs to use cases and queries. A use case could make multiple changes to the system, not just change one table. A query doesn't necessarily map to a single entity either. The result of one query

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

2016-10-20 Thread 'Andrew Radford' via Elm Discuss
Changes like this I think make sense if it is part of a more general effort - i.e 'Elm is going to be known as the language with proper function names"i.e it sounds like a BDFL call. Has that every been stated by Evan or is it just something that appears to be in the same line of thinking as

[elm-discuss] Can I throw strings at the elm compiler

2016-10-20 Thread Adam Fluke
I couldn't find a way to do it, but I thought I would ask anyway. I would like to be able to ask, from node or bash, if a string would compile if it were written to a file. Something like `elm make-but-not-really "not valid string"` -- You received this message because you are subscribed to

[elm-discuss] Can I throw strings at the elm compiler?

2016-10-20 Thread Adam Fluke
So I know that answer may be no, but I thought I'd ask incase I missed something. The short question version of the question: Can I pass strings to the elm compiler to see if they will compile without writing to a file? The long version of the question: I love idea of machine generated

[elm-discuss] Re: Re-position element once its dimension is known

2016-10-20 Thread Erkal Selman
Instead of getting the position, why not putting the dropdown menu into the same div with its button? On Thursday, October 20, 2016 at 10:08:55 AM UTC+2, Jacky See wrote: > > I'm doing some dropdown UI where I would like to re-calculate position of > the element once it appeared on screen. >

Re: [elm-discuss] Re: Do the same with ELM?

2016-10-20 Thread Erkal Selman
I also think that an easy way for sharing examples is a very effective to make elm popular. Mike Bostock did it very well with D3.js: https://bost.ocks.org/mike/example/ >From his talk: I use examples so often that I created bl.ocks.org to make it easier for me > to share them. It lets you

[elm-discuss] Re: Metalinguistic abstractions over databases

2016-10-20 Thread OvermindDL1
On Thursday, October 20, 2016 at 3:55:45 AM UTC-6, Rupert Smith wrote: > > On Wednesday, October 19, 2016 at 8:23:46 PM UTC+1, OvermindDL1 wrote: >> >> Absinthe handles all the nasty parts of GraphQL though, the combining of >> queries, the real-time type documentation generation, etc... etc...

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

2016-10-20 Thread OvermindDL1
On Wednesday, October 19, 2016 at 7:39:25 PM UTC-6, Nathan Schultz wrote: > > 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. > The convention for that in a few other languages is the name 'aux',

Re: [elm-discuss] Proposal: Rename case..of -> match..with

2016-10-20 Thread Peter Damoc
On Thu, Oct 20, 2016 at 5:06 PM, Robin Heggelund Hansen < skinney...@gmail.com> wrote: > The proposal, as the title of the post suggests, is to rename the > "case..of" expression to "match..with". > One added benefit that I'm seeing is that today, if I would have to describe "case...of", I would