I have the feeling that some people think if you can't do it simply without 
a local state then use a ready-made external component. Maybe that's the 
answer after all - I don't know.
I was once told that design patterns exist to address the shortcomings of a 
language & I think it's quite true: the local state problem isn't one in 
other languages with private states (e.g.. object-oriented).
Not having the choice between hiding or showing state in Elm is a mixed 
blessing: it makes the code very easy to reason about & provides strong 
safety guarantees & eases debugging & testing, but on the other hand it 
hurts encapsulation a great deal.
I once thought extensible records might be an answer as each component 
would simply add the states it needs, but it raises the issue of name 
collision (& was removed from the language because, hey, who could possibly 
need such a feature).

I'm starting to think that maybe you should simply use stuff like Polymer, 
knowing that it will probably blow up the quantity of code by fifty.

On Saturday, September 10, 2016 at 10:24:49 AM UTC+2, Peter Damoc wrote:
>
> Do you have an example on how to define a web component in Elm without 
> native code? Or you wanted to say that Elm could be used to define web 
> components internals? 
> If it's the second case, then yes, that would be awesome! 
>  
>
> On Sat, Sep 10, 2016 at 1:02 AM, John Mayer <[email protected] 
> <javascript:>> wrote:
>
>> Has anyone explored using web components (the browser standard)? 
>>
>> Elm can be used to define web component internals, the "build process" 
>> registers the components with the browser, and Elm can also consume web 
>> components as normal HTML as the top-level application. 
>>
>> Might be a worthwhile spike before we commit to developing another coding 
>> pattern.
>>
>  
>
>
>
> -- 
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to