Re: [elm-discuss] Why not components?

2016-12-06 Thread Wouter In t Velt
Thanks for solving this mystery for us David. It probably is sensible to avoid anyway: if someMaybe == ... then And use case someMaybe of (Or .map) instead. Gives us more protection from the compiler to get all branches covered... -- You received this message because you are

Re: [elm-discuss] Why not components?

2016-12-06 Thread David Andrews
They have equality but not comparison. They can't be used as a Dict key, for instance. On Dec 5, 2016 5:39 PM, "Peter Damoc" wrote: > This is weird. > For some reason I got it into my head that tags are not comparable. > Now I can't remember when or why. > > The code seams to

Re: [elm-discuss] Why not components?

2016-12-05 Thread Peter Damoc
This is weird. For some reason I got it into my head that tags are not comparable. Now I can't remember when or why. The code seams to work on my end too and for my sanity I checked it on 0.17 and 0.16 and it works in those versions too. weird. On Mon, Dec 5, 2016 at 11:59 PM, Wouter In t

Re: [elm-discuss] Why not components?

2016-12-05 Thread Wouter In t Velt
Op maandag 5 december 2016 22:51:02 UTC+1 schreef Peter Damoc: > > You cannot use comparison on tags. > I can see your version is cleaner. Do you mean a comparison with a maybe is not allowed? Like this? -- is this not allowed? if someMaybe == Just 42 then ... The original change I made did

Re: [elm-discuss] Why not components?

2016-12-05 Thread Peter Damoc
On Mon, Dec 5, 2016 at 8:38 PM, Wouter In t Velt wrote: > Looks great! I would suggest a small change in the country update: to only > reset the city selector if the country selected is different from the > previous selection. > > CountryPicked country -> >

Re: [elm-discuss] Why not components?

2016-12-05 Thread Peter Damoc
I started out with a bunch of parameters but if I have more than 3 parameters in a function I tend to move towards using a record. As I already pointed out, the API smells. :-) On Mon, 5 Dec 2016 at 20:40, Wouter In t Velt wrote: > Peter, did you deliberately choose to

Re: [elm-discuss] Why not components?

2016-12-05 Thread Wouter In t Velt
Peter, did you deliberately choose to put everything (including items) in a single config record? Just curious. -- 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] Why not components?

2016-12-05 Thread Wouter In t Velt
Op maandag 5 december 2016 16:58:34 UTC+1 schreef Peter Damoc: > > I just pushed the latest changes and the functionality should be > equivalent. > https://github.com/pdamoc/polymer-exploration > Looks great! I would suggest a small change in the country update: to only reset the city selector

Re: [elm-discuss] Why not components?

2016-12-05 Thread Wouter In t Velt
This looks very promising! I really like the fact that the web components solution takes care of the blur stuff, so it makes model cleaner and we can do away with the subscription. I have to do some more digging, but I like the fact that there's a ton of event handlers, that you can simply

Re: [elm-discuss] Why not components?

2016-12-05 Thread Wouter In t Velt
Wow you guys are fast! Hopefully I can dive into it tonight (@work right now). I think it would be really interesting to see a webcomponents version of the same example and compare it with the other two versions. In the meantime, do let me know if there's anything I could improve about my

Re: [elm-discuss] Why not components?

2016-12-05 Thread Peter Damoc
On Mon, Dec 5, 2016 at 4:20 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > Not sure what the problem is, perhaps just styling? I have defeintely been > able to get paper-listbox and paper-item working. See: > > http://www.thesett.com/style-lab/#multiselect > Well...

Re: [elm-discuss] Why not components?

2016-12-05 Thread 'Rupert Smith' via Elm Discuss
On Monday, December 5, 2016 at 1:05:32 PM UTC, Peter Damoc wrote: > > After I found out about elm-polymer library, I tried to reimplement your > example but, I've run into issues. > > This is as far as I got > https://github.com/pdamoc/polymer-exploration > > The problems are due to the way

Re: [elm-discuss] Why not components?

2016-12-05 Thread Peter Damoc
Wouter, After I found out about elm-polymer library, I tried to reimplement your example but, I've run into issues. This is as far as I got https://github.com/pdamoc/polymer-exploration The problems are due to the way children are handled. I tried a fix that I remembered from a previous

Re: [elm-discuss] Why not components?

2016-12-05 Thread David Andrews
A tiny note: To avoid the confusing inclusion of `Position` in `Blur`, you can remove the `Position` and pass `always Blur` to `Mouse.clicks`. On Sun, Dec 4, 2016 at 10:51 AM, Wouter In t Velt wrote: > Op zondag 4 december 2016 15:43:40 UTC+1 schreef Peter Damoc: >> >>

Re: [elm-discuss] Why not components?

2016-12-04 Thread Wouter In t Velt
Op zondag 4 december 2016 15:43:40 UTC+1 schreef Peter Damoc: > > You're trading one set of boilerplate for another. > Fair enough. I could have pointed that out in the conclusions. Both your versions are almost as bad as you are forcing internal details of > the functioning of the dropdown

Re: [elm-discuss] Why not components?

2016-12-04 Thread Peter Damoc
On Sun, Dec 4, 2016 at 1:50 PM, Wouter In t Velt wrote: > Any feedback would be welcome! > > You're trading one set of boilerplate for another. Both your versions are almost as bad as you are forcing internal details of the functioning of the dropdown onto the user of

[elm-discuss] Why not components?

2016-12-04 Thread Wouter In t Velt
Hi All, To explore and explain (in a beginner-friendly way) why making stateful reusable components in Elm is not always a good idea, I have made a demo + write-up in 2 articles over on Medium. Here are the links to the drafts: