[elm-discuss] Re: Sending a message from spawned process

2016-09-20 Thread Brian Cardiff
On Wednesday, September 21, 2016 at 2:09:30 AM UTC-3, Brian Cardiff wrote:
>
> Hi,
>
> In elm 0.17.1, is it possible to send a message to the app from a spawned 
> process? If so, How? :-) 
>
> Some days ago I failed to do that. I wanted to implement a debounce 
> module. The rough idea was that from a message I want to debounce a spawned 
> process would start. First it will do a sleep and then it should message 
> the app.
>
> Spawning the process is required so in the next message of the user, the 
> previous "setTimeout" process can be killed. The Process.Id is needed.
>
> I was forced to take a different approach. Basically, filtering the 
> outdated "setTimeouts". But I would really like to change that.
>
> In case you want to see more source, the package is: 
> http://package.elm-lang.org/packages/bcardiff/elm-debounce/latest/Debounce . 
> And the spawn branch is as far as I got: spawning the process, getting the 
> Id, but unable to receive a message after the sleep.
>
> Thanks in advance,
>

For sure any feedback is welcome. If other approach should/could have been 
taken to debounce events I am all ears, well ... eyes.
 

> -- 
> Brian J. Cardiff - Manas Technology Solutions
> [ar.phone] 4796.0232 #BCR(227)
> [us.phone] 312.612.1050  #BCR(227)
> [email] bcard...@manas.com.ar
> [web] www.manas.com.ar
> [weblog] http://weblogs.manas.com.ar/bcardiff/
>

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


[elm-discuss] Sending a message from spawned process

2016-09-20 Thread Brian J. Cardiff
Hi,

In elm 0.17.1, is it possible to send a message to the app from a spawned
process? If so, How? :-)

Some days ago I failed to do that. I wanted to implement a debounce module.
The rough idea was that from a message I want to debounce a spawned process
would start. First it will do a sleep and then it should message the app.

Spawning the process is required so in the next message of the user, the
previous "setTimeout" process can be killed. The Process.Id is needed.

I was forced to take a different approach. Basically, filtering the
outdated "setTimeouts". But I would really like to change that.

In case you want to see more source, the package is:
http://package.elm-lang.org/packages/bcardiff/elm-debounce/latest/Debounce .
And the spawn branch is as far as I got: spawning the process, getting the
Id, but unable to receive a message after the sleep.

Thanks in advance,
-- 
Brian J. Cardiff - Manas Technology Solutions
[ar.phone] 4796.0232 #BCR(227)
[us.phone] 312.612.1050  #BCR(227)
[email] bcard...@manas.com.ar
[web] www.manas.com.ar
[weblog] http://weblogs.manas.com.ar/bcardiff/

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


[elm-discuss] Re: Suggestion: Add Names and possibly Mascot for Elm-Repl and Elm Online Editor

2016-09-20 Thread Kk Kruups
Hi folks,

I see Peter Damoc, brought up a similar idea 

 
July of last year (2015).





On Wednesday, September 21, 2016 at 11:40:27 AM UTC+9, Kk Kruups wrote:
>
> HI folks,
>
> It would be nice to change add user friendly names to both elm-repl and 
> elm online editor with possible additional Mascots.
>
> For example 
>
> elm-repl could be called elmR 
> elm online editor could be calledelmo
>
> So we would have elmR and elmO sitting under an Elm Tree (Elm logo as an 
> Elm tree(.
>
> I think this would give Elm more appeal to younger folks and pretty kool 
> logos which could be used
> for Conference giveaways and  T-Shirts and stuff.
>
> I think a little marketing would increase appeal!
>
> Referring to elmR and elmO is much nicer than having to refer to items by 
> their cold proper names.
>
> I presume there are some great artist in this forum who could come up with 
> some kool ideas for these character logos
>
> ElmR, Elmo, Elm.
>
>
> Evan what do you say?
>
> BR/KK
>

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


[elm-discuss] Suggestion: Add Names and possibly Mascot for Elm-Repl and Elm Online Editor

2016-09-20 Thread Kk Kruups
HI folks,

It would be nice to change add user friendly names to both elm-repl and elm 
online editor with possible additional Mascots.

For example 

elm-repl could be called elmR 
elm online editor could be calledelmo

So we would have elmR and elmO sitting under an Elm Tree (Elm logo as an 
Elm tree(.

I think this would give Elm more appeal to younger folks and pretty kool 
logos which could be used
for Conference giveaways and  T-Shirts and stuff.

I think a little marketing would increase appeal!

Referring to elmR and elmO is much nicer than having to refer to items by 
their cold proper names.

I presume there are some great artist in this forum who could come up with 
some kool ideas for these character logos

ElmR, Elmo, Elm.


Evan what do you say?

BR/KK

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


[elm-discuss] Looking for Advice on Teaching Web Apps

2016-09-20 Thread Robert Muller
Greetings. I've been writing functional programs since about 1978, first in 
LISP 1.5, then Scheme, and finally ML for the last 25 years or so. I've 
volunteered to teach a Web Apps course at Boston College this spring. I've 
never taught it before. In the absence of job-hunting constraints that my 
students face, I'd probably teach it in Elm, focussing only on the 
front-end.  But my students will be looking to launch actual careers and 
obviously they deserve the best shot possible to get launched. So I am 
wondering what folks in the Elm community might recommend. I'd like to do 
the right thing on both counts.
Thanks in advance for your perspective.
Bob Muller
Computer Science
Boston College

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


Re: [elm-discuss] PSA for beginners

2016-09-20 Thread John Orford
Thanks, this was really good. Really good. Really really good!
On Tue, 20 Sep 2016 at 11:52, Peter Damoc  wrote:

> Watch Richard's talk from the elm-conf.
> https://www.youtube.com/watch?v=IcgmSRJHu_8
>
> Understanding the ideas presented there will improve your code in way that
> will make you want to cry with joy.
>
> What I think Richard is doing there is a demonstration of how to take a
> piece of brittle Carbon and turn it into Lonsdaleite.
>
> Thank you for your attention. :)
>
>
> --
> 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 elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread joseph ni
> - *Elm is an amazing language.* I've had countless moments of sheer 
pleasure programming in Elm for this app. 

Actually, this is *my* take away from the very nicely written, down to 
earth post-mortem. I've been hammering away at web-frameworks for 4 yrs 
(angular, blaze, react) and windows webforms before that. In all those 
frameworks, I have found things that don't fit, workarounds that are hacky, 
abstractions which leak, complex tooling etc etc... in not one of them have 
I said wow... it's been smooth sailing all the way through. Elm is the same 
in that sense. It's story is not complete.

However, in none of those frameworks/languages have I had the consistency 
of highs and pleasure working in a immutable, pure functional environment 
that allows me to express what I want concisely with the confidence that it 
will work as intended. 

Granted I'm not using Elm for a web app, rather a game in Elm, ~6k LoC 
hardly any regression bugs, everything in Elm, it's getting complex, but 
I'm madly refactoring as I go, fearlessly because the compiler's got my 
back. The workflow is great as I'm able to solve problems and move on. I'm 
optimistic about where we're heading :) Don't stop!
 

On Wednesday, 21 September 2016 07:37:30 UTC+10, Brian Marick wrote:
>
>
> On Sep 20, 2016, at 3:46 PM, Peter Damoc  
> wrote:
>
> As Richard pointed out, Elm is a great choice when the team is already 
> comfortable with web-dev. 
> I am a beginner in this field. 
>
>
> I’m a front-end beginner too. I wonder how many of us there are, and how 
> we might help one another.
>

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


Re: [elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread Brian Marick

> On Sep 20, 2016, at 3:46 PM, Peter Damoc  wrote:
> 
> As Richard pointed out, Elm is a great choice when the team is already 
> comfortable with web-dev. 
> I am a beginner in this field. 

I’m a front-end beginner too. I wonder how many of us there are, and how we 
might help one another.

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


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Richard Feldman
No problem! Hope it works well. :)

On Tue, Sep 20, 2016 at 2:22 PM Peter Damoc  wrote:

> Hmm... I tried integrating the icon-toggle-demo and, to my surprise, I got
> it working even if it's past midnight here and I'm dead tired.
>
> I need to explore this some more tomorrow.
>
> Thanks Richard!
>
>
>
> On Tue, Sep 20, 2016 at 7:24 PM, Richard Feldman <
> richard.t.feld...@gmail.com> wrote:
>
>> If nothing is wrong with Web Components, why not use them?
>>
>
 There are a ton of them
 
 you could use right now, for MDL in particular, that work right off the
 shelf.


>>> You make it sound like it's a trivial thing for a beginner to integrate
>>> Polymer with Elm and hit the ground running.
>>>
>>> I seriously doubt that this is the case but I'll take another look at
>>> the projects that have attempted to do this. :)
>>>
>>
>>1. npm install Polymer
>>2. Add  to
>>your index.html
>>3. Add this before the script that imports your elm.js: 
>>// register an element
>>MyElement = Polymer({is: 'my-element',
>>created: function() { this.textContent = 'My element!'; }
>>});
>>
>>4. In your Elm code, run Html.node "my-element" [] []
>>
>> I just tried this and it worked. :)
>>
> --
>>
> 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.
>>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/2RTddO_4rLw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Peter Damoc
Hmm... I tried integrating the icon-toggle-demo and, to my surprise, I got
it working even if it's past midnight here and I'm dead tired.

I need to explore this some more tomorrow.

Thanks Richard!



On Tue, Sep 20, 2016 at 7:24 PM, Richard Feldman <
richard.t.feld...@gmail.com> wrote:

> If nothing is wrong with Web Components, why not use them?
>

>>> There are a ton of them
>>> 
>>> you could use right now, for MDL in particular, that work right off the
>>> shelf.
>>>
>>>
>> You make it sound like it's a trivial thing for a beginner to integrate
>> Polymer with Elm and hit the ground running.
>>
>> I seriously doubt that this is the case but I'll take another look at the
>> projects that have attempted to do this. :)
>>
>
>1. npm install Polymer
>2. Add  to
>your index.html
>3. Add this before the script that imports your elm.js: 
>// register an element
>MyElement = Polymer({is: 'my-element',
>created: function() { this.textContent = 'My element!'; }
>});
>
>4. In your Elm code, run Html.node "my-element" [] []
>
> I just tried this and it worked. :)
>
>> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Richard Feldman
Yeah, I think this is a great thing for people to be playing around with. :)

Underexplored territory!

On Tue, Sep 20, 2016, 2:16 PM James Wilson  wrote:

> I haze thought about using web components like this too. You could even go
> a step further and have web components that embed Elm inside themselves the
> same way you can whack Elm into any other element. So perhaps a collection
> of Elmish web components points one path forward!
>
> The other nice thing about embedding web components into Elm as easily as
> we can is that they can be used to wrap native JS things into El as well.
> For example one might make a web component to render a google map based on
> ita attributes, and in Elm we just Html.node "google-map" [] []. Definitely
> something I need to play with more!
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elm-discuss/2RTddO_4rLw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread James Wilson
I haze thought about using web components like this too. You could even go a 
step further and have web components that embed Elm inside themselves the same 
way you can whack Elm into any other element. So perhaps a collection of Elmish 
web components points one path forward! 

The other nice thing about embedding web components into Elm as easily as we 
can is that they can be used to wrap native JS things into El as well. For 
example one might make a web component to render a google map based on ita 
attributes, and in Elm we just Html.node "google-map" [] []. Definitely 
something I need to play with more!

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


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Nick H
>
> So the question is -- if you treat a TEA program as just a piece of data,
> a four-piece record which does nothing (until you run it with
> Html.program), can you define any standard operations which can take two
> TEA programs and be guaranteed to give you another TEA program?  If there
> were such an operation that operation would be closed.  In the mathematical
> sense.  I think what Peter D. was arguing for.
>

I see. And this kind of thing is only possible if the functions for
analyzing input and producing output are bound with the program state.



On Tue, Sep 20, 2016 at 4:36 AM, Ambrose Laing  wrote:

> I also understood "closure" as used by Abelson to mean closure in the
> mathematical sense.  The notion that if you apply a binary operation to two
> items of one type, you get another item of the same type.  I do see it as
> being strongly related to the question of components or private state.
>
> In elm, we already have examples of closure in being able to combine
> functions to obtain a larger function, combine records to obtain a larger
> record, many Cmd msg to obtain another Cmd msg (using Cmd.batch), etc.
> Abelson's example was one of combining two pieces of a rectangle type, to
> obtain a larger rectangle.
>
> Right now consider what a TEA program is.  One could argue that a TEA
> program is in some sense a piece of data (it is a record with four standard
> components called model, update, view and subscriptions, which must have
> certain types).  If you think of a TEA program this way, it is a piece of
> data that does nothing (analogous to a binary executable).  However if you
> run the TEA program with Html.program or Html.programWithFlags, then it
> becomes an interactive thing, that can pretend to a naive end-user that it
> is stateful (analogous to a process).  We could nit-pick and refine our
> statement to further clarify that it is not in fact stateful in the sense
> of being mutable, but rather uses immutability and that all the true
> statefulness is managed for you by the elm framework.
>
> So the question is -- if you treat a TEA program as just a piece of data,
> a four-piece record which does nothing (until you run it with
> Html.program), can you define any standard operations which can take two
> TEA programs and be guaranteed to give you another TEA program?  If there
> were such an operation that operation would be closed.  In the mathematical
> sense.  I think what Peter D. was arguing for.
>
>
>
> On Tuesday, September 20, 2016 at 1:49:15 AM UTC-4, Nick H wrote:
>>
>> In the lecture Peter links to, the word "closure" is just being used to
>> mean a function `a -> a`, where the return type matches the argument type.
>> Like the mathematical sense of "the integers are closed with respect to
>> addition."
>>
>> Its a useful property for a function to have, but in the sense used here,
>> it's not really related to the question of components or private state.
>>
>> On Mon, Sep 19, 2016 at 10:34 PM, Max Goldstein 
>> wrote:
>>
>>> Closure sounds like a nice property in theory. In practice, it's built
>>> on the idea that you have to hide things, because things tend to break and
>>> encapsulation is the only way to keep that breakage from spiraling out of
>>> control. But in Elm, things don't break very often, and when they do the
>>> compiler is there to catch them. So don't worry about components, just use
>>> functions.
>>>
>>> That said, there's a very important point in OP about state for HTML
>>> tags. For example, the reuse section of the guide  has an example with
>>> checkboxes. These boxes send messages to toggle their state when they are
>>> clicked. But, there is no way to pre-populate the state of the checkboxes
>>> for example with information you get from the server. In another thread, I
>>> think this is worth discussing. If some HTML components are state full what
>>> do we do about that, without jumping down the rabbit hole of components?
>>>
>>> --
>>> 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...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

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


[elm-discuss] Re: Elm, Objects and Components

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 12:30:03 PM UTC+1, Gusztáv Szikszai wrote:
>
> Also maybe you don't know but I've created Elm-UI  
> just for the same reason: to quickly build stuff from the same components 
> just like Bootstrap. And it solves many of the problems that seems you are 
> facing, the downside of it is that it's not in the official repository 
> because well it "doesn't play nice". It uses the standard TEA where 
> components with their own state and I think that is just fine it doesn't 
> need to be more simple or complicated then that. And the communication is 
> solved by allowing the components to publish messages to anyone who is 
> subscribing to them.
>

I'm intrigued. How did you implement the component pub/sub bit? 

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


Re: [elm-discuss] Re: Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 4:53:42 PM UTC+1, Janis Voigtländer wrote:
>
> So the definition of List might look like:
>
> type List a
> = Nil
> | Cons a (List a)
>
> That’s exactly how the definition of List would look like if it didn’t 
> have a native implementation.
>
> So it seems you already know everything.
>
:-) Sweet. 20 years ago I was a CS undergrad and they made us learn ML. I 
did my final year project in Moscow ML (a compiler) and my masters project 
in OCaml (an AI pattern matching thing). I remember at the time saying "it 
will be 20 years before this stuff becomes mainstream". Well, I think ocaml 
and haskell have made some good progress in that time. I haven't touched it 
though for 20 years, so its taking a while to figure things out again.

One of the reasons I found it so hard to learn javascript is that I could 
not find a readable book on the subject. I definitely think the Elm docs 
need a lot of work because they leave a lot of gaps. Perhaps the upcoming 
"Elm in Action" book will be comprehensive in its coverage:

https://www.manning.com/books/elm-in-action

 

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


Re: [elm-discuss] Re: Elm, Objects and Components

2016-09-20 Thread Duane Johnson
On Tue, Sep 20, 2016 at 8:34 AM, Max Goldstein 
wrote:

> Respectfully, the discussions around components keep happening because
> people start them. Asking "how do I have stateful components with
> closure/nesting" falls prey to the XY problem, and also misses a lot of the
> philosophy of language design that Evan has talked about, most recently in
> his elm-conf keynote . To
> paraphrase, Elm is a young language and we're more concerned with doing
> things right for the future than making a good language today. Another key
> quote from his status updates: *choose not to block*. Going around and
> demanding new language features that fit your style of code is not helpful.
>

FWIW, I appreciate Peter's questions, and I don't interpret "What am I
missing?" and "Why not have...?" as demands. I like Evan's approach to
language change and anticipate it will lead to a better Elm. As we gather
the batch of problems that will lead to insight, I think the user stories
and context around them are also important.

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


Re: [elm-discuss] Re: Some questions about types.

2016-09-20 Thread Janis Voigtländer
So the definition of List might look like:

type List a
= Nil
| Cons a (List a)

That’s exactly how the definition of List would look like if it didn’t have
a native implementation.

So it seems you already know everything.
​

2016-09-20 17:25 GMT+02:00 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com>:

> Some more questions about types. I just ran into the recursive 'type
> alias' issue:
>
> https://github.com/elm-lang/elm-compiler/blob/0.17.1/
> hints/recursive-alias.md
>
> which is clear enough. It seems a bit of a shame that some of this
> documentation is a bit buried away - it really feels like this should be in
> the syntax guide (or whatever chapter comes after the syntax guide).
> Anyway, the other questions:
>
> Can type definitions be recursive? as per ML, I think the answer is yes.
>
> type Expression
>   = Integer Int
>   | Sum Expression Expression
>
> for a simple syntax tree representing expressions over integers and
> addition.
>
> I have seen some type definitions like this:
>
> type Cmd msg = Cmd
>
> but I am more used to seeing type definitions that look like this:
>
> type Msg
>   = SomeMsg String
>   | ...
>
> What does the 'msg' parameter on this type do? Does it just mean that the
> type is polymorphic and the 'msg' is the type parameter? So the definition
> of List might look like:
>
> type List a
>  = Nil
>  | Cons a (List a)
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Brian Marick

> On Sep 20, 2016, at 3:21 AM, Richard Feldman  
> wrote:
> 
> 
> If nothing is wrong with Web Components, why not use them?
> 
> There are a ton of them 
>  you 
> could use right now, for MDL in particular, that work right off the shelf.
> 
> Why block on a hypothetical future language feature when there already exists 
> a way for you to code your Elm application the way you would if that feature 
> existed?

Is there any sample code I can look at to see how to do this? (Note: very much 
a front-end newbie - tell me if using them would be too much of a leap.)

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


[elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Monday, September 19, 2016 at 2:08:43 PM UTC+1, Peter Damoc wrote:
>
> I keep postponing this for a few weeks but today my partner decided to 
> stop the collaboration and I'll take advantage of this moment to write this 
> post mortem.
>

Di your 'collaboration' end because Elm turned out to be the wrong tool for 
the job? Or did it end for other unrelated reasons?

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


[elm-discuss] Re: Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
Some more questions about types. I just ran into the recursive 'type alias' 
issue:

https://github.com/elm-lang/elm-compiler/blob/0.17.1/hints/recursive-alias.md

which is clear enough. It seems a bit of a shame that some of this 
documentation is a bit buried away - it really feels like this should be in 
the syntax guide (or whatever chapter comes after the syntax guide). 
Anyway, the other questions:

Can type definitions be recursive? as per ML, I think the answer is yes.

type Expression
  = Integer Int
  | Sum Expression Expression

for a simple syntax tree representing expressions over integers and 
addition.

I have seen some type definitions like this:

type Cmd msg = Cmd

but I am more used to seeing type definitions that look like this:

type Msg
  = SomeMsg String
  | ...

What does the 'msg' parameter on this type do? Does it just mean that the 
type is polymorphic and the 'msg' is the type parameter? So the definition 
of List might look like:

type List a
 = Nil
 | Cons a (List a)

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


Re: [elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread Peter Damoc
On Tue, Sep 20, 2016 at 5:18 PM, Lars Jacobsson 
wrote:

> Peter - just out of curiosity: How did you split those 8000 LOC up? Did
> you go for a structured component/react type splitup, or did you split
> "organically" when the need occurred?
>

It was more of an organic kind of split, mostly around functionality.

With the exception of some static pages that were handled directly by the
MainApp.elm, all the other pages had their own separate file.
Most of them were following TEA but some ended up not needing their own
model and update because they could delegate their actions to the top
level.
Functionality around routing was in its own file, same for the server
access API.
Business Objects Types were in their own file that was imported all over
the place
Serialization (encoders and decoders) was in its own file.
There was a Components.elm that was mainly various aggregates of elm-html
(simple functions).
There were also a few components (Dropbox, Carousel) that lived in their
own .elm files.
Some complex forms got also extracted at one point into their own files.
There were also some CSS only files.
One of them, SharedCSS.elm taught me a very important lesson:
Don't put code that changes frequently in a file that is imported by a lot
of other files.
changes to this file led to the longest compilation times. :)





-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Elm, Objects and Components

2016-09-20 Thread Max Goldstein

>
> If Elm provides an official way to use TEA in order to implement Custom 
> Elements *the discussions around Components will go away.*
>

 For example, if elm-html library would be supplemented by an elm-ui 
> library that is just as easy to use as elm-html but it is as extensive as 
> Semantic UI and just as customizable (themes) *the discussion around 
> small stateful components might just go away. *


Respectfully, the discussions around components keep happening because 
people start them. Asking "how do I have stateful components with 
closure/nesting" falls prey to the XY problem, and also misses a lot of the 
philosophy of language design that Evan has talked about, most recently in 
his elm-conf keynote . To 
paraphrase, Elm is a young language and we're more concerned with doing 
things right for the future than making a good language today. Another key 
quote from his status updates: *choose not to block*. Going around and 
demanding new language features that fit your style of code is not helpful.

And by the XY problem, once again I ask that if the fundamental concern is 
the statefulness of HTML tags like dropdowns, let's address that in another 
thread. Getting HTML to do everything it can do when managed by JS is a web 
platform concern. Let's come up with specific examples of things we can't 
do (not just can't do easily, can't do at all) with HTML inputs.

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


[elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread OvermindDL1
SCSS helps 'some' of the CSS woes at least.  I keep my CSS outside of elm 
and in SCSS and it works decently(ish).


On Tuesday, September 20, 2016 at 7:20:32 AM UTC-6, Rupert Smith wrote:
>
> On Monday, September 19, 2016 at 6:18:33 PM UTC+1, Rex van der Spuy wrote:
>>
>> CSS is hell-on-wheels: the most time I've spent debugging my Elm apps 
>> have not been with my Elm code, but with the CSS.
>>
>> Hey, Elm Community, we've solved JavaScript now we need a real solution 
>> to CSS! :)
>>
>
> I have decided to just stick with keeping the CSS out of Elm. Partly 
> because I need to share the CSS with other projects that are not using Elm. 
> Partly because I already have a good understanding of how to make use of 
> SCSS and Compass. Partly because it seems quicker and easier to develop the 
> CSS and test it with some static HTML served up by node express. Partly 
> because learning to use elm-css is just one thing too many for me to figure 
> out now.
>
> So it feels to me that Elm is neither helping or hindering my styling 
> efforts - yes, CSS can be very time consuming. 
>

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


[elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread Lars Jacobsson
Peter - just out of curiosity: How did you split those 8000 LOC up? Did you 
go for a structured component/react type splitup, or did you split 
"organically" when the need occurred?

>
>
> Another large amount of time was spent trying to integrate a carousel. I 
> ended up reimplementing a bare bone version in pure Elm. 
>
> By the end, the code grew to about 8000 LOC of Elm. 
>
>

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


[elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread Lars Jacobsson
Peter - just out of curiosity: How did you split those 8000 LOC up? Did you 
go for a structured component/react type splitup, or did you split 
"organically" when the need occurred?


On Monday, September 19, 2016 at 3:08:43 PM UTC+2, Peter Damoc wrote:
>
> I keep postponing this for a few weeks but today my partner decided to 
> stop the collaboration and I'll take advantage of this moment to write this 
> post mortem. 
>
> *Context*
>
> I was approached by a friend few months ago about a B2B project that was 
> supposed to help small businesses issue beautiful invoices. It was suppose 
> to be a free product that would synergize with some other products that his 
> business was already delivering. I was supposed to implement it and he 
> would do all the marketing and promotion.
>
> Having total freedom, I decided to use Elm to implement the platform in 
> cooperation with another part-time programmer that would do a JSON backend 
> in PHP. 
>
> The product required that the interface would be modern, responsive, 
> dynamic and look great. 
>
> *Beginning Phase*
>
> The first phase of the development was dominated by personal attempts at 
> reimplementing reactive design elements such as drawers that show on big 
> screens and hide on small devices. After a few buggy attempts I ended up 
> trowing everything away and switching to elm-mdl. 
>
> A considerable amount of time was also invested at this point to set up 
> some kind of automatic build environment. I ended up with a solution based 
> on gulp. 
>
> *Middle Phase *
>
> Once the build environment was set up, things started to move a little 
> faster. I then ended up needing CSS and after playing a little bit with 
> elm-css and hitting several missing properties I decided to implement my 
> own library, taking inspiration from all 3 libraries that were dealing with 
> style (rtfeldman/elm-css, elm-style and massung/elm-css). In hindsight this 
> might have been a rather bad idea for productivity reasons but I have 
> learned a lot. 
>
> *Ending Phase *
>
> After I passed the 5000 LOC mark, things really started to crumble around 
> me. My mind could no longer deal with the complexity I have created. 
> Most of the brain cyles in this phase have been wasted trying to use the 
> little JS I know to try and somehow add to my Elm UI some widgets that I 
> needed. I have failed.
>
> I have spent an inordinate amount of time trying to add some Dropdowns to 
> some forms I had, ending up reimplementing part of them in Elm and using 
> some CSS form the Semantic UI project. 
>
> Another large amount of time was spent trying to integrate a carousel. I 
> ended up reimplementing a bare bone version in pure Elm. 
>
> By the end, the code grew to about 8000 LOC of Elm. 
>
> *Conclusions *
>
> - *Elm is an amazing language.* I've had countless moments of sheer 
> pleasure programing in Elm for this app. 
> - *Elm lacks the full story. *My main hope was that I could implement the 
> app even if I had very little CSS or JS knowledge. I could not do this. Elm 
> does not have yet something that would allow someone to stop touching CSS. 
> -* I would not recommend webdev beginners to take the approach I took.* 
> It is better for now to stay the tried and proven path and just use Elm to 
> implement smaller components in another web framework. 
> - *The tooling around producing a deliverable elm webapp are simply not 
> ready yet.* 
>
>
> Thank you for taking the time to read this. 
> If any of you has curiosities around this experience, feel free to ask me 
> anything. :) 
>
>
>
>
>
> -- 
> 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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 2:37:29 PM UTC+1, Rupert Smith wrote:
>
> On Tuesday, September 20, 2016 at 2:08:31 PM UTC+1, Joey Eremondi wrote:
>>
>> Both int and float end up as a JS number at the end of the day, so 
>> definitely bounded. Defer to the JS spec?
>>
>
> http://www.w3schools.com/js/js_numbers.asp
>
> Says "Javascript numbers are always 64-bit floating point". 
>
> Which means a 52-bit mantissa, so ints are bit less than 64-bit... bit of 
> a bugger as that means where I have used a 64-bit for an object id, I 
> should really pass as a String and parse into a Data.Integer. Thanks.
>

Or just use a String for that case. I can treat all ids as opaque String 
values.

I can probably also user String for big decimals, since the aim would be to 
capture/display a decimal value such that binary rounding errors are not 
introduced, rather than to perform arithmetic with them.

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


Re: [elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 2:08:31 PM UTC+1, Joey Eremondi wrote:
>
> Both int and float end up as a JS number at the end of the day, so 
> definitely bounded. Defer to the JS spec?
>

http://www.w3schools.com/js/js_numbers.asp

Says "Javascript numbers are always 64-bit floating point". 

Which means a 52-bit mantissa, so ints are bit less than 64-bit... bit of a 
bugger as that means where I have used a 64-bit for an object id, I should 
really pass as a String and parse into a Data.Integer. Thanks.

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


[elm-discuss] Re: Http 401 Interceptor? My 3rd Elm Project - authentication

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Sunday, September 18, 2016 at 9:33:14 PM UTC+1, Erik Lott wrote:
>
> I'm not sure what the outmessage package is that you linked to, but you 
> don't need a package to manage this. An outmsg is just a messge that is 
> returned from the update function, to notify the function caller of 
> something important that happened internally. If you're new to elm, it's 
> probably better to wire an OutMsg yourself, just so you know exactly what's 
> going on with the code. If you haven't yet seen the Sortable Table Example 
> , you should have a close 
> look at the code. You'll see great examples of the update and view method 
> returning useful messages.
>

Yes, I have struggled a bit to figure out how to do that, because I have 
split the code into module, and the return type of the 'update' function in 
a module is different to the return type of the 'update' function in the 
top-level module. How does one translate between those types?

I can see how it is done for a view, using Html.App.map.

How do I trigger a Cmd on the top-level from the update function of a 
module? Must be something to do with Cmd.map...?
 

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


[elm-discuss] Re: Post mortem for my first attempt at using Elm in a real app.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Monday, September 19, 2016 at 6:18:33 PM UTC+1, Rex van der Spuy wrote:
>
> CSS is hell-on-wheels: the most time I've spent debugging my Elm apps have 
> not been with my Elm code, but with the CSS.
>
> Hey, Elm Community, we've solved JavaScript now we need a real solution to 
> CSS! :)
>

I have decided to just stick with keeping the CSS out of Elm. Partly 
because I need to share the CSS with other projects that are not using Elm. 
Partly because I already have a good understanding of how to make use of 
SCSS and Compass. Partly because it seems quicker and easier to develop the 
CSS and test it with some static HTML served up by node express. Partly 
because learning to use elm-css is just one thing too many for me to figure 
out now.

So it feels to me that Elm is neither helping or hindering my styling 
efforts - yes, CSS can be very time consuming. 

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


Re: [elm-discuss] Some questions about types.

2016-09-20 Thread Janis Voigtländer
http://package.elm-lang.org/packages/javcasas/elm-integer/latest
​

2016-09-20 15:08 GMT+02:00 Joey Eremondi :

> Both int and float end up as a JS number at the end of the day, so
> definitely bounded. Defer to the JS spec?
>
> Not sure about bignum, there's definitely not language support, but there
> might be a library doing it somewhere, and if not, someone should write
> one!
>
> On Sep 20, 2016 10:03 PM, "'Rupert Smith' via Elm Discuss" <
> elm-discuss@googlegroups.com> wrote:
>
>> Is Int unbounded? I mean is it a 'big integer' implementation as per ML,
>> or is it 64-bit or soe other limit?
>>
>> What is the precision of a Float? Is it the same as 64-bit IEEE 754?
>>
>> Is there a 'big decimal' representation?
>>
>> The docs around the basics of syntax don't really cover this:
>> http://elm-lang.org/docs/syntax#type-annotations
>>
>> --
>> 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.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [elm-discuss] Some questions about types.

2016-09-20 Thread Joey Eremondi
Both int and float end up as a JS number at the end of the day, so
definitely bounded. Defer to the JS spec?

Not sure about bignum, there's definitely not language support, but there
might be a library doing it somewhere, and if not, someone should write
one!

On Sep 20, 2016 10:03 PM, "'Rupert Smith' via Elm Discuss" <
elm-discuss@googlegroups.com> wrote:

> Is Int unbounded? I mean is it a 'big integer' implementation as per ML,
> or is it 64-bit or soe other limit?
>
> What is the precision of a Float? Is it the same as 64-bit IEEE 754?
>
> Is there a 'big decimal' representation?
>
> The docs around the basics of syntax don't really cover this:
> http://elm-lang.org/docs/syntax#type-annotations
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

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


[elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
Is Int unbounded? I mean is it a 'big integer' implementation as per ML, or 
is it 64-bit or soe other limit?

What is the precision of a Float? Is it the same as 64-bit IEEE 754?

Is there a 'big decimal' representation?

The docs around the basics of syntax don't really cover this: 
http://elm-lang.org/docs/syntax#type-annotations

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


Re: [elm-discuss] Re: Elm, Objects and Components

2016-09-20 Thread Peter Damoc
On Tue, Sep 20, 2016 at 2:30 PM, Gusztáv Szikszai 
wrote:

> Also maybe you don't know but I've created Elm-UI 
> just for the same reason: to quickly build stuff from the same components
> just like Bootstrap. And it solves many of the problems that seems you are
> facing, the downside of it is that it's not in the official repository
> because well it "doesn't play nice". It uses the standard TEA where
> components with their own state and I think that is just fine it doesn't
> need to be more simple or complicated then that. And the communication is
> solved by allowing the components to publish messages to anyone who is
> subscribing to them.
>

I know about Elm-UI, I actually looked a little bit at it when I evaluated
the options I had when I started the projects who's death I documented in
the other thread.
To be honest, it felt even more riskier to go with that than it did to go
elm-mdl.

elm-ui project also shows the impact of not using an official way on
contributions. A lot more people contributed to elm-mdl than to elm-ui.
Now, this might be because this is how you want it (similar to what Evan
does for the core) but somehow I think that this might not be the case.




-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Peter Damoc
On Tue, Sep 20, 2016 at 2:36 PM, Ambrose Laing  wrote:

> So the question is -- if you treat a TEA program as just a piece of data,
> a four-piece record which does nothing (until you run it with
> Html.program), can you define any standard operations which can take two
> TEA programs and be guaranteed to give you another TEA program?  If there
> were such an operation that operation would be closed.  In the mathematical
> sense.  I think what Peter D. was arguing for.
>

Yes, that is the point.

Right now, main accepts Html, if the output of `Platform.program` would be
`Html`, then this would constitute a component that could be mixed with
other components and could also be used as the value for `main`.

programWithFlags could become just a regular function that would mimic the
API of a regular component (config -> Html msg)
programWithFlags : Flags -> Html msg

Maybe Html would not be the best name, maybe UI would be better. The idea
being that one would have a way to talk about this things just as
pleasantly as they can talk about html components.


-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread John Mayer
Here are my questions

How do you define a web component in Elm. What's the boilerplate? Can it be
auto-generated from any Elm app? (my gut here says that ports become
similar to on-change events)

How do you consume web components with Elm's virtual-dom. Are there issues?
There used to be concerns surrounding the virtual DOM and the shadow DOM
interaction.

Ignoring non-Elm boilerplate, is the code better? Does it solve our
concerns about components?

How's performance compared to using the top-level dispatcher (particularly
at scale - e.g. hundreds of datepickers)

If all of the above are favorable, then we can start thinking about adding
a feature to Elm.

I think we learn a lot by running this experiment.

On Sep 20, 2016 6:15 AM, "John Mayer"  wrote:

> You shouldn't need Polymer. Just web components, which are a standard and
> implemented in most browsers (probably all browsers on which Elm runs).
>
> It will be a few dozen lines of JS and HTML, and there might be quirks. If
> it works, it still won't be super elegant, but it could build the case for
> adopting the standard as part of Elm if these experiments go well.
>
> On Sep 20, 2016 5:00 AM, "Peter Damoc"  wrote:
>
>> On Tue, Sep 20, 2016 at 11:21 AM, Richard Feldman <
>> richard.t.feld...@gmail.com> wrote:
>>
>>>
> If nothing is wrong with Web Components, why not use them?
>>>
>>> There are a ton of them
>>> 
>>> you could use right now, for MDL in particular, that work right off the
>>> shelf.
>>>
>>>
>> You make it sound like it's a trivial thing for a beginner to integrate
>> Polymer with Elm and hit the ground running.
>>
>> I seriously doubt that this is the case but I'll take another look at the
>> projects that have attempted to do this. :)
>>
>>
>> --
>> 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 elm-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread John Mayer
You shouldn't need Polymer. Just web components, which are a standard and
implemented in most browsers (probably all browsers on which Elm runs).

It will be a few dozen lines of JS and HTML, and there might be quirks. If
it works, it still won't be super elegant, but it could build the case for
adopting the standard as part of Elm if these experiments go well.

On Sep 20, 2016 5:00 AM, "Peter Damoc"  wrote:

> On Tue, Sep 20, 2016 at 11:21 AM, Richard Feldman <
> richard.t.feld...@gmail.com> wrote:
>
>>
 If nothing is wrong with Web Components, why not use them?
>>
>> There are a ton of them
>>  you
>> could use right now, for MDL in particular, that work right off the shelf.
>>
>>
> You make it sound like it's a trivial thing for a beginner to integrate
> Polymer with Elm and hit the ground running.
>
> I seriously doubt that this is the case but I'll take another look at the
> projects that have attempted to do this. :)
>
>
> --
> 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 elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[elm-discuss] PSA for beginners

2016-09-20 Thread Peter Damoc
Watch Richard's talk from the elm-conf.
https://www.youtube.com/watch?v=IcgmSRJHu_8

Understanding the ideas presented there will improve your code in way that
will make you want to cry with joy.

What I think Richard is doing there is a demonstration of how to take a
piece of brittle Carbon and turn it into Lonsdaleite.

Thank you for your attention. :)


-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Peter Damoc
On Tue, Sep 20, 2016 at 11:21 AM, Richard Feldman <
richard.t.feld...@gmail.com> wrote:

>
>>> If nothing is wrong with Web Components, why not use them?
>
> There are a ton of them
>  you
> could use right now, for MDL in particular, that work right off the shelf.
>
>
You make it sound like it's a trivial thing for a beginner to integrate
Polymer with Elm and hit the ground running.

I seriously doubt that this is the case but I'll take another look at the
projects that have attempted to do this. :)


-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread John Orford
(I found MDL web components to be pretty hit and miss when used with Elm -
perhaps that's changed since 0.16 - would love to hear more on this topic)


On Tue, 20 Sep 2016 at 10:21 Richard Feldman 
wrote:

>  Or you can define a Web Component
>>>  like
>>>  and then call node "myRadioButton" to create one. No
>>> C++ involved.
>>>
>>> What's wrong with that?
>>>
>>> Nothing.
>> If Elm provides an official way to use TEA in order to implement Custom
>> Elements the discussions around Components will go away.
>> If someone comes and says "What if I have many small components that are
>> unavoidably stateful" the answer would be, "just use
>> elm-lang/custom-element"
>>
>
> If nothing is wrong with Web Components, why not use them?
>
> There are a ton of them
>  you
> could use right now, for MDL in particular, that work right off the shelf.
>
> Why block on a hypothetical future language feature when there already
> exists a way for you to code your Elm application the way you would if that
> feature existed?
>
>> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [elm-discuss] Elm, Objects and Components

2016-09-20 Thread Peter Damoc
On Tue, Sep 20, 2016 at 4:29 AM, Ian Mackenzie 
wrote:

> Peter, you may be interested in (and I'd appreciate your feedback on) a
> little library I've been working on for composable input widgets:
> https://github.com/kintail/input-widget
>

I took a superficial look at the library and it looks very interesting.
I need to play with it a little bit in order to give a proper feedback but
I wanted to say that this looks similar to an idea I had (around
serializing internal messages and internal state) only that it looks much
much better.
I'll get back with more feedback.


On Tue, Sep 20, 2016 at 5:39 AM, Richard Feldman <
richard.t.feld...@gmail.com> wrote:

> If these components are implemented in C++ and wrapped by the virtual-dom,
>>> we are lucky, we can use them. If they are not, we are out of luck.
>>>
>>
>  Or you can define a Web Component
>  like
>  and then call node "myRadioButton" to create one. No C++
> involved.
>
> What's wrong with that?
>
> Nothing.
If Elm provides an official way to use TEA in order to implement Custom
Elements the discussions around Components will go away.
If someone comes and says "What if I have many small components that are
unavoidably stateful" the answer would be, "just use
elm-lang/custom-element"

I would also like to add that actual Custom Elements aren't even truly
needed here.
If an hypothetical elm-lang/custom-element library would create just
regular virtual-dom elements the issue would still be solved.


On Tue, Sep 20, 2016 at 5:47 AM, Nick H  wrote:

> Peter, I also think the pain that you are feeling has a lot to do with the
> fact that there simply aren't very many UI libraries for Elm. Elm-mdl is
> the only one I ever hear anybody talk about. You are asking for an
> officially-sanctioned alternative to elm-mdl, but why does there need to be
> one?
>

Just to clarify a little bit, I was asking for an officially sanctioned
alternative to the approach elm-mdl took, not of the actual library.

The need for something like this stems from the fact that if we want to
promote elm to be an alternative to current front-end technologies, you
have to cater to beginners. They too should be able to create great
webpages.
The only way a beginner can create something nice looking and modern is to
rest on the work done by others. To use "components" that others have
implemented and optimized.

For example, I can take something like
http://www.creative-tim.com/live/paper-kit-pro
and with very little knowledge produce something that looks nice.

This would be close to impossible for a beginner with minimal CSS knowledge
working directly with elm-html and some external CSS tool or maybe elm-css.

There is also the "constrains liberate" idea. If the beginner has a great
library, they can stay within that library and be free from the hustle of
choosing which UI library to choose.
For example, if elm-html library would be supplemented by an elm-ui library
that is just as easy to use as elm-html but it is as extensive as Semantic
UI and just as customizable (themes) the discussion around small stateful
components might just go away.
elm-mdl might get reimplemented as just another theme of that elm-ui OR
they might use elm-ui as an example and do a similar implementation
(assuming that elm-ui does not rest itself on some Native code).





-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.