Re: [elm-discuss] Elm Architecture in Vanilla JS

2017-02-25 Thread Eric G
There was a discussion on this awhile back on reddit, see https://www.reddit.com/r/elm/comments/5q4nji/closest_elm_architecture_in_js/ My personal favorite and I believe closest to Elm (0.16) is outlined here: https://github.com/paldepind/functional-frontend-architecture On Saturday, February 2

Re: [elm-discuss] Elm Architecture in Vanilla JS

2017-02-25 Thread Robert Muller
Thank you! Very informative and laugh-out-loud funny! Really helpful, thanks! - Bob On Sat, Feb 25, 2017 at 7:27 PM, Witold Szczerba wrote: > Hi, > so you want to carry The Elm Architecture (TEA) to the "vanilla JS" world. > I came across recently an article: "How I converted my React app to >

Re: [elm-discuss] Designing with sum and product types

2017-02-25 Thread Eric G
Thanks for this discussion, these kinds of modelling decisions I feel like I struggle with over and over. And inevitably I get something not quite right and then later have a massive cleanup to do since everything else depends on the shape of the model :( I like your step by step procedure Rup

Re: [elm-discuss] Elm Architecture in Vanilla JS

2017-02-25 Thread Witold Szczerba
Hi, so you want to carry The Elm Architecture (TEA) to the "vanilla JS" world. I came across recently an article: "How I converted my React app to VanillaJS". React is quite similar to TEA, actually it's React/Redux that is similar, but still, I think you could find something useful there. https://

[elm-discuss] Elm Architecture in Vanilla JS

2017-02-25 Thread Robert Muller
Greetings. I'm an OCaml guy, teaching Web Apps for the first time and finding my way through the insanity that is HTML + CSS + JS and trying to impart something sensible to students for how to structure their vanilla JS apps to conform to the the Elm Architecture (model-view-update). First time

Re: [elm-discuss] How up update sub-models ...

2017-02-25 Thread Michael Johnson
That worked!! Good to know!! I will do that next time. Thank you! -- 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. Fo

Re: [elm-discuss] How up update sub-models ...

2017-02-25 Thread Witold Szczerba
Hi, that would be so much easier to help you if you would have prepared an executable using runelm.io or ellie-app.com. Taking a quick look at your update function I would suggest: InputEmail email -> { model | email = StringField email (validateEmail email) } ! [] Regards, Wi

Re: [elm-discuss] How up update sub-models ...

2017-02-25 Thread Michael Johnson
Thanks for the quick reply!! I'm not sure I'm following that. I'm trying that code and it does not know what the "emailModel" and "passwordModel" are. Cannot find variable `emailModel` 52| ( { model | email = { emailModel | value = email, errors = validateEmail email } }, Cmd.none )

Re: [elm-discuss] How up update sub-models ...

2017-02-25 Thread Duane Johnson
I think what you're looking for is this syntax: ( { model | email = { emailModel | value = email, errors = validateEmail email } }, Cmd.none ) and ( { model | password = { passwordModel | value = password, errors = validatePassword password } }, Cmd.none ) On Sat, Feb 25, 2017 at 2:08 PM, Micha

[elm-discuss] How up update sub-models ...

2017-02-25 Thread Michael Johnson
Hello, new to elm and experimenting around with it and I'm not sure how to update a sub model. I have not run across an example of this form yet. Given the following: -- MODEL type alias StringField = { value : String , errors : List String } --> how to update value and erro

[elm-discuss] import Json.Decode problem, and creating commands

2017-02-25 Thread Tomasz Primke
I use Elm 0.18. I have written the following, simple Elm program. It is supposed to accumulate values, sent from JS. I'd also like to get the accumulated value from the program, back to JS. port module App exposing (..) import Json.Decode import Task -- model ty

Re: [elm-discuss] Can I run Elm with/on Nodejs

2017-02-25 Thread art yerkes
I've also been using elm on the server side, and have some thoughts: In elm-0.18 you'll use a Platform.program or Platform.programWithFlags and pass command line arguments via the flags from a small javascript runner. Unlike Sonny Michaud's approach, I've used the normal init/update/subscripti

[elm-discuss] Re: webpack hotloading: compile errror leads to loss of state

2017-02-25 Thread Simon
Aha, that's promising I have my own starter https://github.com/simonh1000/elm-hot-loading-starter and have tried https://github.com/halfzebra/create-elm-app and both experienced the issues I described. I will take a look at what you do Simon On Saturday, 25 February 2017 18:13:09 UTC+1, Austin

[elm-discuss] Re: webpack hotloading: compile errror leads to loss of state

2017-02-25 Thread Rex van der Spuy
This isn't really a "solution" to your problem, but because I had endless frustrating headaches with elm-webpack-starter I switched to the much simpler elm-live: https://github.com/tomekwi/elm-live and create-elm-app: https://github.com/halfzebra/create-elm-app/blob/master/template/README.md

[elm-discuss] Re: webpack hotloading: compile errror leads to loss of state

2017-02-25 Thread Austin Bingham
Is this with elm-webpack-loader, or some other package? I use elm-webpack-loader and the webpack-dev-server, and it definitely recovers after a broken compilation. You can see my configuration here if that helps: https://github.com/abingham/accu-2017-elm-app On Saturday, February 25, 2017 at 4:

[elm-discuss] webpack hotloading: compile errror leads to loss of state

2017-02-25 Thread Simon
I have tried webpack directly and some of the starters, but I can't find a way to use hotloading after making a change that led to a compiler error. It only works if you write perfect code and recompile. If you have an error, then when these have been fixed the page reloads with the default sta

[elm-discuss] Re: can't understand compiler error

2017-02-25 Thread agjf . tucker
I just did this exercise too! My solution was to perform the validation from the update function and to save the error messages in the model. On Saturday, 25 February 2017 06:55:06 UTC, Anurup Mitra wrote: > > Dear Alex, > > This is very elegant indeed! I am bowled over by the simplicity of it a

Re: [elm-discuss] Elm and contenteditable

2017-02-25 Thread Witold Szczerba
One trick I have learned when integrating date range picker is that you can push data from component to Elm using custom HTML events instead of sending data through a port(s). I have described it shortly here: https://www.reddit.com/r/elm/comments/5uqa13/those_fancy_date_pickers_in_elm_watch_this_n