[elm-discuss] Re: Syntax suggestion: record property shorthand

2016-09-12 Thread Oliver Searle-Barnes
While I like the JS style syntax it feels a little early to be optimising out line noise. In particular nested updates don't seem entirely resolved yet, if new syntax were introduced it would be good to be aware of it when deciding whether this optimisation is appropriate. On Sunday, 11

[elm-discuss] Minimize Javascript for deploys

2016-09-12 Thread Jim Freeze
Hi I can't seem to find in the docs how to minimize the javascript for production. Does elm provide these tools or are we to use other tools to uglify and minimize the javascript? Thank you. -- Dr. Jim Freeze, Ph.D. (m) 512 949 9683 -- You received this message because you are subscribed to

Re: [elm-discuss] Re: What languages do you write your back-ends in?

2016-09-12 Thread Dave Rapin
LFE looks very cool, going to check it out. On Mon, Sep 12, 2016 at 11:57 AM, OvermindDL1 wrote: > I'm using Elixir as well currently, and no, its type system kind of sucks, > however you can enforce both types and even values within on function calls > via matchspecs and

Re: [elm-discuss] Duck typing in Elm ? Pitching to dynamic languages people..

2016-09-12 Thread Nick H
I strongly disagree with your colleague's claims: * It is hard to test statically typed languages. (Although I don't think Java is a good language for other reasons, it does have some excellent testing frameworks.) * You should use duck typing in your tests. (Duck-typing in tests is an indication

[elm-discuss] Re: Long form: how to handle model, Msg and update?

2016-09-12 Thread Ambrose Laing
Something like this can be made to work, if you don't care about relaxing the type safety which is provided by your current approach: initialModel = { form : Dict.fromList [ ("applicant", { label = "Applicant name" , selected = True , value = ""

Re: [elm-discuss] Re: Long form: how to handle model, Msg and update?

2016-09-12 Thread Eduardo Cuducos
Many thanks, Ambrose! That was very helpful indeed ; ) Gonna make it work. On Mon, Sep 12, 2016 at 4:15 PM Ambrose Laing wrote: > Something like this can be made to work, if you don't care about relaxing > the type safety which is provided by your current approach: > > >

Re: [elm-discuss] Re: What languages do you write your back-ends in?

2016-09-12 Thread OvermindDL1
I use LFE for a lot of little here, it is quite nice, and also made by one of the original Erlang devs. :-) On Monday, September 12, 2016 at 10:10:19 AM UTC-6, Dave Rapin wrote: > > LFE looks very cool, going to check it out. > > On Mon, Sep 12, 2016 at 11:57 AM, OvermindDL1

Re: [elm-discuss] Minimize Javascript for deploys

2016-09-12 Thread Nick H
Yes, Elm doesn't prescribe anything in particular. Just use uglify or whatever else you want. On Mon, Sep 12, 2016 at 9:29 AM, Jim Freeze wrote: > Hi > > I can't seem to find in the docs how to minimize the javascript for > production. > > Does elm provide these tools or

[elm-discuss] Re: What languages do you write your back-ends in?

2016-09-12 Thread 'Rupert Smith' via Elm Discuss
On Saturday, September 10, 2016 at 8:41:22 AM UTC+1, Mario Sangiorgio wrote: > > I was wondering what programming language you use to implement the > back-end for your Elm single page web app. > Java. -- You received this message because you are subscribed to the Google Groups "Elm Discuss"

[elm-discuss] Re: Minimize Javascript for deploys

2016-09-12 Thread Dmytro Gladkyi
I just use gulp-minify from npmjs: var minify = require("gulp-minify"); gulp.task("minify", ["build-elm"], function() {return gulp.src("./elm.js") //elm.js is what elm-make outputs.pipe(minify()) .pipe(gulp.dest("./"));}); I also tried Google Closure Compiler - but it gave me

Re: [elm-discuss] Re: Long form: how to handle model, Msg and update?

2016-09-12 Thread Ambrose Kofi Laing
There is a bug in my code which is that Dict.get returns a Maybe, so you will have to handle the possibility that the fieldName is not found using maybe case entry of Just something -> ... Nothing -> ... On Mon, Sep 12, 2016 at 3:16 PM, Eduardo Cuducos wrote: > Many

Re: [elm-discuss] Duck typing in Elm ? Pitching to dynamic languages people..

2016-09-12 Thread Max Goldstein
Thanks for the elm-test shoutout, Nick! It's easy to implement the foo function, let's use a more concrete example: getName : User -> String getName = .name We've aliased the built-in accessor so that it may only be used on Users, not any record with a name field. We've also declared that this

Re: [elm-discuss] Re: Long form: how to handle model, Msg and update?

2016-09-12 Thread Eduardo Cuducos
No worries, Ambrose. I haven't read you snippets literally, but they were quite expressive in the sense of showing me how Dict could work in my case. Already treated the Maybe cases and it's working beautifully. Once more, thank you very much ; ) On Mon, Sep 12, 2016 at 4:19 PM Ambrose Kofi Laing

[elm-discuss] Re: Dead code elimination and the future of elm-runtime.js

2016-09-12 Thread OvermindDL1
>From my experience my elm app freshly compiled ends up at 2369KB, after closure, uglifyjs, etc... it ends up at 1145KB, then when gzipped it ends up at 338KB. This is still pretty large considering the old react version of some of the components I replaced were less that 400KB pre-shrinking

[elm-discuss] Re: What languages do you write your back-ends in?

2016-09-12 Thread OvermindDL1
I'm using Elixir as well currently, and no, its type system kind of sucks, however you can enforce both types and even values within on function calls via matchspecs and 'when' clauses (which are very simple and succinct). However, Elixir is an immutable functional language and its matchspecs

[elm-discuss] Should I expect the same rendered HTML/SVG from elm-reactor and elm-make

2016-09-12 Thread Salomon Turgman Cohen
Dear all, I am trying to figure out whether I am facing a bug or desired behavior. I have the following code: import Svg exposing (..) import Svg.Attributes exposing (..) main = svg [ version "1.1", x "0", y "0", height "100%", width "100%" ] [ circle [ r "40%", cx "50%", cy

[elm-discuss] Re: Duck typing in Elm ? Pitching to dynamic languages people..

2016-09-12 Thread OvermindDL1
For note, you can and should still type all of that, foo could be typed: ```elm foo : { x : Int } -> Int -- Or even looser: foo : { x : a } -> a ``` If, however, foo only ever takes a User then User should be specified to help constrain it. But if foo is generic enough (like yours above), then