[elm-discuss] Re: Batching HTTP requests and then performing something after they all finish

2017-12-02 Thread Eric G
If you model the dict values (image URLs) with something like type AlbumImageState = NotLoaded | Cached Url | Loaded Url | Error Http.Error Would that help? When you get back the list in the first request, initialize the values to NotLoaded. Then you could then write a function

[elm-discuss] Re: Batching HTTP requests and then performing something after they all finish

2017-12-02 Thread Eric G
If you model the dict values (image URLs) with something like type AlbumImageState = NotLoaded | Cached Url | Loaded Url | Error Http.Error Would that help? When you get back the list in the first request, initialize the values to NotLoaded. Then you could then write a function

[elm-discuss] Re: Batching HTTP requests and then performing something after they all finish

2017-12-03 Thread Eric G
On Sunday, December 3, 2017 at 8:25:37 AM UTC-5, Rafał Cieślak wrote: > > Eric: This is what I meant when I suggested wrapping the URLs with > RemoteData > . ;) > It does pretty much exactly what you described and I'm thinking

[elm-discuss] Re: Discussion: formats for sharing data between Haskell server and Elm client

2016-07-19 Thread Eric G
This is an ancient thread, but has anyone done further work on an Elm decoder/code generator for Cap'n Proto (or similar binary serialization formats) ? I see there is one for OCaml: https://github.com/pelzlpj/capnp-ocaml . Growing weary of packing and unpacking JSON on both client and server

Re: [elm-discuss] Re: Discussion: formats for sharing data between Haskell server and Elm client

2016-07-20 Thread Eric G
Great, thanks! On Wednesday, July 20, 2016 at 1:32:35 AM UTC-4, Peter Damoc wrote: > > Have a look here: > https://groups.google.com/forum/#!topic/elm-discuss/4jOpKeBs7yo > > On Wed, Jul 20, 2016 at 2:55 AM, Eric G > > wrote: > >> This is an ancient thread, but h

[elm-discuss] Re: Do the counters in the Guide teach us a wrong scaling approach?

2016-08-28 Thread Eric G
My take on it is - the standard "counter" examples are used not just in Elm but in lots of virtual-dom-based frameworks, I used to hate them as well but now I see their usefulness as a "Short, Self Contained, Correct Example" in which the domain has been reduced to the bare minimum. And I have

[elm-discuss] Re: Do the counters in the Guide teach us a wrong scaling approach?

2016-08-28 Thread Eric G
On Sunday, August 28, 2016 at 7:02:04 AM UTC-4, Wouter In t Velt wrote: > > >- Forget about about "components": the term is very confusing, means >very different things in different contexts. >- Start to build with 1 Model, 1 Msg, 1 update, 1 view >- As soon as one these becomes t

[elm-discuss] Re: Pairing Session Video: Josh Adams and Luke Westby pairing on server-side-validations

2016-09-10 Thread Eric G
Haven't watched the video but wanted to say just reading through your "annotated diffs" I could mostly follow along, thanks! (I'm working on something similar now -- not using elm-simple-form or elm-mdl, but it was still extremely helpful to see how you did it.) On Friday, September 9, 2016 at

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

2016-09-11 Thread Eric G
Python at the moment (on Google App Engine), increasingly written in a Elm-y/monadic style ;) On Sunday, September 11, 2016 at 12:36:03 PM UTC-4, John Mayer wrote: > > I'll buck the trend and share that I'm happily using Java 8 as my backend. > I use protocol buffers over websockets to communic

[elm-discuss] Re: How to make a view with a list of components

2016-09-24 Thread Eric G
Hi Antoine, I think you can use function composition like this to make it easier: List.map (viewLog >> App.map TaskLog) task.logs instead of the double List.map with helper function. This maps each `viewLog log` to the TaskLog-wrapped msg type, in one step. Eric On Saturday, September 24, 20

[elm-discuss] Re: Modeling cross-references

2016-09-24 Thread Eric G
Thanks for this question and the suggestions - very useful to issues I am dealing with now. Some questions: - Is it better to use Dicts as the basic 'table' structure, if frequently rendering lists of items filtered and sorted in various ways? In short, is it better to convert a `List (ID, It

[elm-discuss] Re: Modeling cross-references

2016-09-25 Thread Eric G
Thanks Francesco and Wouter, your suggestions confirm what I was thinking too. Still getting used to the idea of having normalized data in the client - it seems mildly irritating to have to do joins client-side instead of in the database. But on the plus side maybe I can ditch my ORM on the se

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

2016-10-17 Thread Eric G
I'm no expert, and would like clarification on this as well, but "pages of an app" seems like the main place where using nested modules makes sense -- unless your pages can be modeled more easily as variants of each other, as sometimes happens. My experience* has been that just about everywher

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

2016-11-01 Thread Eric G
Just wanted to say, thanks for posting this Kasey. It's great to hear the nasty details, though I'm sure it's not so great to live with them day to day :) It's a great point about implicit behavior pushing off programming from the system onto the users. Thanks also for the links. I have been

[elm-discuss] Re: Embracing out messages

2016-11-05 Thread Eric G
Thanks for writing this up Mark, it seems very clear. It seems like it would be especially good for cases where results of effects need to be applied further up the state tree from where the effect is triggered. Or for cases where you want to examine (and possibly modify) requested effects furt

[elm-discuss] Re: Return of Http.url function

2016-12-07 Thread Eric G
I agree `Http.url` was useful. Looks like there is a PR for it. https://github.com/elm-lang/http/issues/10 In the meantime elm-lang/http exposes encodeUri which is the "hard part" of building URIs, so you could make your own (or just copy it from https://github.com/evancz/elm-http/blob/3.0.1/

Re: [elm-discuss] Maintainers wanted

2017-01-22 Thread Eric G
Yes, and thanks for your excellent work Bogdan! I have learned a lot from reading/using your libraries. Eric On Saturday, January 21, 2017 at 11:06:35 AM UTC-5, Simon wrote: > > Despite the growth and strength of the Elm community, it is worth saying > that your absence will really be missed Bo

Re: [elm-discuss] Re: Html.Attributes.none

2017-01-24 Thread Eric G
Yes. In the past I've used `property "" Json.Encode.null` for this, which seemed to avoid setting a dummy attribute, but I have no idea how accidental that is and if it works for browsers other than Chrome. On Tuesday, January 24, 2017 at 10:41:02 PM UTC-5, Mark Hamburg wrote: > > Agreed. I wa

[elm-discuss] Re: Using Elm with existing UI controls

2017-02-02 Thread Eric G
Not a maintainer, but what about http://faq.elm-community.org/ ? On Thursday, February 2, 2017 at 7:31:30 PM UTC-5, Joe Andaverde wrote: > > Elm maintainers: where would be the best place to document this use case? > I'd hate for this to be lost in a sea of threads. > > On Tuesday, January 31, 20

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 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] Cmd.map

2017-03-30 Thread Eric G
I agree with Mark. In addition, to avoid circular dependencies it means you have to put your top-level Msg type in a separate module with no dependencies on the module where your update is defined. I strongly prefer to have the Msg type next to the update. Ok, the compiler will still save you w

[elm-discuss] Re: Looking for a reasonable way to conditionally handle an element and all of its childern losing focus

2017-04-06 Thread Eric G
I did this by requiring an id for the menu element in config, and then checking the id of relatedTarget against this, on blur. See: https://github.com/ericgj/elm-autoinput/blob/master/src/Autoinput.elm#L357 I'm not convinced it's the best way but it worked for me for the moment. On Thursday,

[elm-discuss] Re: Scaling Elm

2017-04-19 Thread Eric G
I think this would be great to have and would be glad to contribute. Just to be clear, you are proposing we come up with one set of functionality, that then multiple people implement using different approaches? Like TodoMVC, but a larger example that also encompasses server communication and b

[elm-discuss] Re: Poll for Intermediate to Advanced topics that people struggle with

2017-04-24 Thread Eric G
Data modelling and refactoring. "Making impossible states impossible", perhaps starting with basic problems and working up to more realistic tangles of conditions. On Monday, April 24, 2017 at 10:06:53 AM UTC-4, Jeff Schomay wrote: > > Hello, > > I am considering doing some training material on

[elm-discuss] Re: Discovery: Model /= Database

2017-05-01 Thread Eric G
This topic is a bit all over the place, but just wanted to chime in with a different approach that I've found works pretty well for updating database-backed state, especially in contexts where you aren't syncing with the backend via websockets or similar. That is to follow the principle: no dat

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-08 Thread Eric G
Good question, I'd like to hear what other people do as well. Just to add two other options to the mix: 5. Link to an example that uses the package in Ellie (https://ellie-app.com/) 6. Deploy an example to the Github project page (https://username.github.io/package/ ) 5. Is quick and painless

[elm-discuss] Re: Best practices to create examples for an elm package?

2017-05-11 Thread Eric G
On Thursday, May 11, 2017 at 10:49:17 AM UTC-4, Jakub Hampl wrote: > > In elm-visualisation I use option #3 but build things into a /docs > directory that github serves. This is done via > https://github.com/gampleman/elm-example-publisher, which has a UI > somewhat resembling bl.ocks.org > S