[elm-discuss] Re: Which text editor do you prefer for Elm?

2016-10-05 Thread Basel Hamadeh
I use Vim as my main text editor and i just started with Elm and i find the 
elm plugin for vim pretty good

On Wednesday, August 10, 2016 at 6:47:34 PM UTC+8, Rupert Smith wrote:
>
> I'm trying the Elm emacs mode, but it is pretty bad. If I select and 
> indent a whole file for example all the import statements and statements 
> within a let .. in get indented +1 more level as you go down the list. 
> Sometimes it crashes and busy spins Emacs too.
>
> Something better would be appreciated. :-)
>

-- 
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: keeping functions out of the model

2016-10-05 Thread Mark Hamburg

> On Oct 5, 2016, at 6:17 PM, Joel Clermont  wrote:
> 
> Equality: Similar to serialization, is this just a matter of me having to be 
> smarter when doing manual optimizations that look at model equality? Or is 
> there something in the runtime/compiler that is going to break or be less 
> optimized as a result?

If you (or anyone else contributing code to your project including any public 
Elm packages) use == with values that might contain functions, you have a 
lurking runtime error waiting to happen.

Spreading the paranoia,
Mark

-- 
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: keeping functions out of the model

2016-10-05 Thread Max Goldstein
Thank you for your kind words, Joel.

If 0.18 debugging totally breaks an animations, I'll think of something. 
These are some valid concerns but I haven't seen a smoking gun yet.

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread Ed Ilyin
I have created very tiny example of how to use polymer element in Elm:
https://github.com/edvail/double-event-issue

But, dear, why events are duplicated?
Each typed character fires two identical events.

Il giorno mer 5 ott 2016 alle ore 18:18 Peter Damoc  ha
scritto:

> I have no idea what is happening there but I would sure love to see what
> comes up as a solution.
>
>
>
> On Wed, Oct 5, 2016 at 7:00 PM, 'Rupert Smith' via Elm Discuss <
> elm-discuss@googlegroups.com> wrote:
>
> On Wednesday, October 5, 2016 at 4:59:17 PM UTC+1, Rupert Smith wrote:
>
> On Wednesday, October 5, 2016 at 4:48:59 PM UTC+1, Peter Damoc wrote:
>
> This is very interesting.
> Can you share some code so others can look at this?
>
>
> Its here:
>
> https://github.com/rupertlssmith/thesett_style_lab
>
>
> Running here:
>
> http://www.thesett.com/style-lab/#multiselect
>
> --
> 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.
>

-- 
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: JS + React + Redux - How to emulate Elm?

2016-10-05 Thread Nicolas Artman
Here are some tools and libraries I think are worth looking into to give a 
redux application a more Elm feel:

Eslint-plugin-immutable 
—one 
of the most critical pieces.
Redux Saga  / Redux Loop 
 and disallow 
redux-thunk/redux-promise use
Redux Actions , then name your 
action creators as if they're types (UpdateFoo)
Immutable.js —I prefer using this 
only for the store, rather than all data.
Recompose —to help write view 
functions in a more natural style
Reslect  is generally great and, while 
I'm not sure if it directly mirrors anything in Elm, makes it easier to 
write your application in an elm-like fashion.
Flow  or TypeScript  if 
you want some semblance of type support

On Wednesday, October 5, 2016 at 9:34:38 AM UTC-7, Bulat Shamsutdinov wrote:
>
> Hello! 
>
> After several weeks of learning elm (pleasant time) I found out that for 
> reasons outside of my control I'm to use JS + React + Redux for now. 
>
> Do anyone knows of a way to use JS+React+Redux in a manner close to Elm? 
>
> I want to try to emulate elm architecture and whole FP paradigm as 
> puristic as possible. 
>
> Are there any links to tutorials or something?
>

-- 
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: How to decode a recursive JSON from a port?

2016-10-05 Thread Wil Chung
Ah. Dammit. It must have been late. I had put in a JS object, gotten
another error, and thought it was because of the same problem.

Then, subsequently, how do I write the childrenDecoder for a recursive
model?

I'm doing the customDecoder, but I'm getting the error: "TypeError: Cannot
read property 'tag' of undefined"

childrenDecoder : Decoder Children
> childrenDecoder =
>   customDecoder
> (Json.list nodeDecoder)
> (\children -> Result.Ok <| Children children)


This seems like it makes sense. a customDecoder run identifies children as
a Json.list of nodeDecoders, and when we get the list of decoders, we put
it into Children, and wrap it in Result.

When looking at where the error points to, it looks like it's a large
switch statement where the JSON decoder is looking for the decoder's tag,
in order to figure out what to do next. I'm guessing that as a
customDecoder, there's no tag, and hence it's failing out.

I feel like I'm not getting exactly what to do in the case of a recursive
model.

Wil

On Wednesday, October 5, 2016 at 9:08:48 AM UTC-7, Max Goldstein wrote:
>
> To clarify Rupert: try removing the JSON.stringify call. Elm expects
> actual objects, not a string representation of objects. I think.

-- 
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] Functional programming, or why should I use Elm instead of vanilla javaScript?

2016-10-05 Thread Sarkis Arutiunian


Recently I read article about Functional programming, all 5 parts 
.
 
Yes it's pretty interesting article, written in interesting way. And I 
really like pattern of 'functional programming', immutability and etc.


But there is a question. Where the line between propriety and paranoia?


I prefer use native javaScript for everything where I can do it without any 
libraries. Yes exactly you should use some UI libraries like React and some 
module bundler like webpack. But I think propriety of using this tools is 
obvious. It's better to use JSX then use native js to create DOM or it's 
better to use webpack at least to uglify and optimize your code because 
some things just impossible to achieve without webpack.

And we have absolutely opposite situation with Elm. Yes they have some 
features to make function a little bit shorter than you'll do it in vanilla 
javaScript and only in some case. It's not that difference like create 
nodes with JSX or js.


And all this stuff about immutability, can be easily achieved in plain 
javaScript. Eventually is Elm code will be converted to plain javaScript 
and not vice versa, so that's mean you can do all that stuff in javaScript 
but for sure there are some features in javaScript which you can't do in 
Elm. And using Elm you are limited with one pattern. And what if it's not 
enough or it's not best solution in some case, what than? For example right 
now I'm working on new CMS for one of my projects, on React/GraphQL/Nodejs 
and hybrid storage MongoDb with mySQL. I would like to use this pattern in 
some cases but I just can't use it everywhere, so that's mean I shouldn't 
use Elm?


Don't think that I'm against to Elm. I just want to see opinion of others. 
And I want to see that line, between propriety and paranoia.


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: Teaching children Elm

2016-10-05 Thread Fed Reggiardo
Recently I've been working on some projects creating music in the browser 
with teens.  I get them hooked with simple HTML + CSS projects so they can 
quickly see tangible results.  Them slowly add some fun JS; in our case Web 
Audio but you could also do SVG, CSS animations, Canvas, etc.  Giving them 
some interactive bits of code that they can tinker with themselves to 
create cool things certainly can't hurt.  You can layer the meatier Elm 
topics on top of that.  

On Tuesday, October 4, 2016 at 12:33:04 AM UTC-5, Fedor Nezhivoi wrote:
>
> Hello folks,
>
>
> Evan, Richard and the whole community as well as Elm language itself do a 
> great job in teaching community. If you are staying with this community for 
> a long time, you probably already can notice some improvements in your 
> understanding of programming, API design, abstractions and etc. How can we 
> take it even further?
>
>
> Recently I got an opportunity to share some knowledge about functional 
> programming and programming in general. However target audience are 
> children (mostly 14-16 y.o.) and I am a little bit stuck. Not only I've 
> never been a teacher, but with children I expect it to be even harder 
> because of curse of knowledge. On the other hand trying to teach some 
> boring basics doesn't feel right, to be interesting it should be kind of 
> journey.
>
>
> Previously there was some information about courses in USA where children 
> are thought programming with Elm. So I am kindly ask people who are doing 
> this to share your experience, tips, tricks and whatever may be helpful. It 
> would be even better if you can share some actual 
> content/topics/lessons/exercises. If you know exact person, but they are 
> not here, please, provide me with contacts.
>
>
> *I am kindly ask you to abstain from discussions and only participate if 
> you have something concrete.*
>
>
> Have a nice day!
>

-- 
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: JS + React + Redux - How to emulate Elm?

2016-10-05 Thread Bulat Shamsutdinov
It's not the answer for my case because React + Redux is the stack I'm to 
use now. But I will still look into it just because it looks interesting, 
thank you!

On Wednesday, October 5, 2016 at 7:54:44 PM UTC+3, Charlie Koster wrote:
>
> I don't know if this is what you're looking for but rather than 
> React/Redux I personally think CycleJS  is far 
> closer to Elm. It uses observables to chain up pure functions. Side effects 
> are handed off to the "CycleJS runtime" to do things like update the DOM or 
> perform HTTP requests.
>
> It's definitely not the same. It's definitely not the Elm architecture. 
> But you'll recognize the purity of its strategy.
>

-- 
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: Teaching children Elm

2016-10-05 Thread Rex van der Spuy

On Tuesday, October 4, 2016 at 9:08:45 PM UTC-4, Tanya Bouman wrote:
>
> We have also developed our own graphics library 
> http://package.elm-lang.org/packages/MacCASOutreach/graphicsvg/latest/GraphicSVG
>  
> which makes it easy to use notifications. 
>

This is awesome!!! 

-- 
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: JS + React + Redux - How to emulate Elm?

2016-10-05 Thread Charlie Koster
I don't know if this is what you're looking for but rather than React/Redux 
I personally think CycleJS  is far closer to Elm. It 
uses observables to chain up pure functions. Side effects are handed off to 
the "CycleJS runtime" to do things like update the DOM or perform HTTP 
requests.

It's definitely not the same. It's definitely not the Elm architecture. But 
you'll recognize the purity of its strategy.

-- 
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] JS + React + Redux - How to emulate Elm?

2016-10-05 Thread Bulat Shamsutdinov
Hello! 

After several weeks of learning elm (pleasant time) I found out that for 
reasons outside of my control I'm to use JS + React + Redux for now. 

Do anyone knows of a way to use JS+React+Redux in a manner close to Elm? 

I want to try to emulate elm architecture and whole FP paradigm as puristic 
as possible. 

Are there any links to tutorials or something?

-- 
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: Backend to use with Elm

2016-10-05 Thread Bulat Shamsutdinov
Oh, that looks interesting, thank you for sharing! I'm going to look into 
it.

On Wednesday, October 5, 2016 at 6:40:12 PM UTC+3, Charles Scalfani wrote:
>
> We're developing Elm programs that run in node. See 
> https://github.com/panosoft?utf8=%E2%9C%93=elm
>
> I just finished a Postgres Effects Manager and I'm working on a Websocket 
> server Effects Manager.
>
> You can definitely write Elm on node. You're pretty much on your own, but 
> it's doable.
>
>
>  
>
> On Tuesday, October 4, 2016 at 11:29:22 AM UTC-7, Bulat Shamsutdinov wrote:
>>
>> Hello everyone!
>>
>> I'm an experienced developer but newbie in web. I chose to learn Elm in 
>> order to avoid all the complexity with JS and it's ecosystem (learned JS 
>> and Node on a decent level and feel like I don't want to touch it ever 
>> again without a great need).
>>
>> Is there something as good for the back-end? It would be great to use 
>> something opinionated, light, simple and functional maybe. 
>>
>> I learned myself some Golang and it is ok, I learned Node and it is not 
>> ok. Are there any "Elm-way" options (maybe not with the language itself but 
>> with the same philosophy)?
>>
>> If there was no one to ask I would go with Golang, but there is)
>>
>

-- 
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: Teaching children Elm

2016-10-05 Thread Will White
What about a homework diary?

On Wednesday, October 5, 2016 at 11:43:40 AM UTC+1, Will White wrote:
>
> Knowing (ahead of time) if there's someone in the class with a good idea 
> for an application would be gold.
>
> On Tuesday, October 4, 2016 at 6:33:04 AM UTC+1, Fedor Nezhivoi wrote:
>>
>> Hello folks,
>>
>>
>> Evan, Richard and the whole community as well as Elm language itself do a 
>> great job in teaching community. If you are staying with this community for 
>> a long time, you probably already can notice some improvements in your 
>> understanding of programming, API design, abstractions and etc. How can we 
>> take it even further?
>>
>>
>> Recently I got an opportunity to share some knowledge about functional 
>> programming and programming in general. However target audience are 
>> children (mostly 14-16 y.o.) and I am a little bit stuck. Not only I've 
>> never been a teacher, but with children I expect it to be even harder 
>> because of curse of knowledge. On the other hand trying to teach some 
>> boring basics doesn't feel right, to be interesting it should be kind of 
>> journey.
>>
>>
>> Previously there was some information about courses in USA where children 
>> are thought programming with Elm. So I am kindly ask people who are doing 
>> this to share your experience, tips, tricks and whatever may be helpful. It 
>> would be even better if you can share some actual 
>> content/topics/lessons/exercises. If you know exact person, but they are 
>> not here, please, provide me with contacts.
>>
>>
>> *I am kindly ask you to abstain from discussions and only participate if 
>> you have something concrete.*
>>
>>
>> Have a nice day!
>>
>

-- 
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: keeping functions out of the model

2016-10-05 Thread Max Goldstein
Zinggi: My objection is that the easing function is part of the logical 
identity of the animation. It's tedious to keep track of the function 
separately. Also, animation concepts like velocity and retargetting rely on the 
easing function. "The same animation with a different easing function"… is not 
the same animation. 

-- 
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: How to decode a recursive JSON from a port?

2016-10-05 Thread Max Goldstein
To clarify Rupert: try removing the JSON.stringify call. Elm expects actual 
objects, not a string representation of objects. I think. 

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 4:59:17 PM UTC+1, Rupert Smith wrote:
>
> On Wednesday, October 5, 2016 at 4:48:59 PM UTC+1, Peter Damoc wrote:
>>
>> This is very interesting. 
>> Can you share some code so others can look at this? 
>>
>
> Its here:
>
> https://github.com/rupertlssmith/thesett_style_lab
>

Running here:

http://www.thesett.com/style-lab/#multiselect

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 4:48:59 PM UTC+1, Peter Damoc wrote:
>
> This is very interesting. 
> Can you share some code so others can look at this? 
>

Its here:

https://github.com/rupertlssmith/thesett_style_lab

I have no idea how I hook into the events that it generates using 'on', 
will have to leave that for tomorrow. 

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread Peter Damoc
This is very interesting.
Can you share some code so others can look at this?




On Wed, Oct 5, 2016 at 6:42 PM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> On Wednesday, October 5, 2016 at 11:44:35 AM UTC+1, Rupert Smith wrote:
>>
>> I am going to give this a go, as I need an MDL styles multi-select
>>
>
> So I can get the select box to appear, but as soon as I click on it, it
> vanishes. Is this where Html.Keyed helps me out somehow? I did try creating
> the paper-listbox and paper-item nodes as keyed nodes, but it stills
> dissapears
>
> --
> 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.


[elm-discuss] Re: Backend to use with Elm

2016-10-05 Thread Charles Scalfani
We're developing Elm programs that run in node. 
See https://github.com/panosoft?utf8=%E2%9C%93=elm

I just finished a Postgres Effects Manager and I'm working on a Websocket 
server Effects Manager.

You can definitely write Elm on node. You're pretty much on your own, but 
it's doable.


 

On Tuesday, October 4, 2016 at 11:29:22 AM UTC-7, Bulat Shamsutdinov wrote:
>
> Hello everyone!
>
> I'm an experienced developer but newbie in web. I chose to learn Elm in 
> order to avoid all the complexity with JS and it's ecosystem (learned JS 
> and Node on a decent level and feel like I don't want to touch it ever 
> again without a great need).
>
> Is there something as good for the back-end? It would be great to use 
> something opinionated, light, simple and functional maybe. 
>
> I learned myself some Golang and it is ok, I learned Node and it is not 
> ok. Are there any "Elm-way" options (maybe not with the language itself but 
> with the same philosophy)?
>
> If there was no one to ask I would go with Golang, but there is)
>

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread Peter Damoc
This is discussed in the video that I linked earlier.

In a very simple demo he end up with 65 HTTP requests.
That might be a lot.

Also, in a more advanced app that number could be quite higher.

However, the reason that I said that Polymers do not work like that is that
if they would have worked like that, it would have been made explicit by
Google.

I might be wrong. :)



On Wed, Oct 5, 2016 at 6:03 PM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote:
>>
>> Polymers do not work like that.
>>
>
> Why do you say this, in relation to using a CDN to fetch the bits? Is it
> because you always use vulcanize to package the component lib up into your
> own customized version of it? There is no option to just fetch it piece by
> piece from the google CDN? Also, I see there are many dependencies as you
> say, so perhaps lots of little CDN downloads does not compare so well with
> downloading the customized pacakge.
>
> --
> 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.


[elm-discuss] Re: Which text editor do you prefer for Elm?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 3:15:42 PM UTC+1, Kristo Koert wrote:
>
> I use spacemacs with the Elm layer 
> https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/elm 
>

Looks interesting. That could tempt me back to emacs.

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote:
>
> Polymers do not work like that. 
>

Why do you say this, in relation to using a CDN to fetch the bits? Is it 
because you always use vulcanize to package the component lib up into your 
own customized version of it? There is no option to just fetch it piece by 
piece from the google CDN? Also, I see there are many dependencies as you 
say, so perhaps lots of little CDN downloads does not compare so well with 
downloading the customized pacakge. 

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread Peter Damoc
Yes!

Also, if you naively import it without importing the dependencies, the JS
Console will give you clues about missing links.

as for the bower dependencies you listed, yes... they are all needed.

The polymer project has and insane amount of dependencies.
It's like every function in elm-html would become it's own module.




On Wed, Oct 5, 2016 at 5:32 PM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

>
>
> On Wednesday, October 5, 2016 at 3:28:31 PM UTC+1, Rupert Smith wrote:
>>
>> On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote:
>>>
>>> Polymers do not work like that.
>>> For optimizing the size, see the links I posted in the previous comment.
>>>
>>> I have a personal exploration of polymer that tried to minimize the
>>> output:
>>> https://github.com/pdamoc/polymer-exploration
>>>
>>
>> First hurdle, there is no polymer-paper-listbox bower package, so I guess
>> I need to create one? Are all these bower dependencies really needed to
>> build a functioning date picker?
>>
>>   "dependencies": {
>> "moment-element": "bendavis78/moment-element#^1.1.1",
>> "polymer": "Polymer/polymer#^1.1.0",
>> "iron-icon": "PolymerElements/iron-icon#^1.0.7",
>> "iron-iconset-svg": "PolymerElements/iron-iconset-svg#^1.0.9",
>> "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
>> "iron-media-query": "PolymerElements/iron-media-query#^1.0.0",
>> "iron-resizable": "PolymerElements/iron-resizable-behavior#^1.0.0",
>> "iron-selector": "PolymerElements/iron-selector#^1.0.0",
>> "neon-animation": "PolymerElements/neon-animation#^1.0.0",
>> "paper-ripple": "PolymerElements/paper-ripple#^1.0.5",
>> "paper-styles": "PolymerElements/paper-styles#^1.0.0",
>> "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
>> "iron-list": "PolymerElements/iron-list#^1.2.8"
>>   },
>>
>> from:
>>
>> https://github.com/bendavis78/paper-date-picker
>>
>> Kind of hard to figure out what I need for the listbox...
>>
>
> I guess the html imports for the demo of the listbox gives me some clue:
>
>   
>
>   
>   
>   
>   
>
> from:
>
> https://github.com/PolymerElements/paper-listbox/
> blob/master/demo/index.html
>
> --
> 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] Re: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 3:32:21 PM UTC+1, Rupert Smith wrote:
>
>
>
> On Wednesday, October 5, 2016 at 3:28:31 PM UTC+1, Rupert Smith wrote:
>>
>> On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote:
>>>
>>> Polymers do not work like that. 
>>> For optimizing the size, see the links I posted in the previous comment. 
>>>
>>> I have a personal exploration of polymer that tried to minimize the 
>>> output:
>>> https://github.com/pdamoc/polymer-exploration
>>>
>>
>> First hurdle, there is no polymer-paper-listbox bower package, so I guess 
>> I need to create one? Are all these bower dependencies really needed to 
>> build a functioning date picker?
>>
>
Actually, I think I just need this:

"PolymerElements/paper-listbox#^1.1.2"

plus maybe some of the dependencies from the demo of it. I don't need to 
create a whole package as complex as the date-picker one, that only exists 
because it is building a new component on top of other components from 
PolymerElements which does not already have a date picker.


-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss


On Wednesday, October 5, 2016 at 3:28:31 PM UTC+1, Rupert Smith wrote:
>
> On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote:
>>
>> Polymers do not work like that. 
>> For optimizing the size, see the links I posted in the previous comment. 
>>
>> I have a personal exploration of polymer that tried to minimize the 
>> output:
>> https://github.com/pdamoc/polymer-exploration
>>
>
> First hurdle, there is no polymer-paper-listbox bower package, so I guess 
> I need to create one? Are all these bower dependencies really needed to 
> build a functioning date picker?
>
>   "dependencies": {
> "moment-element": "bendavis78/moment-element#^1.1.1",
> "polymer": "Polymer/polymer#^1.1.0",
> "iron-icon": "PolymerElements/iron-icon#^1.0.7",
> "iron-iconset-svg": "PolymerElements/iron-iconset-svg#^1.0.9",
> "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
> "iron-media-query": "PolymerElements/iron-media-query#^1.0.0",
> "iron-resizable": "PolymerElements/iron-resizable-behavior#^1.0.0",
> "iron-selector": "PolymerElements/iron-selector#^1.0.0",
> "neon-animation": "PolymerElements/neon-animation#^1.0.0",
> "paper-ripple": "PolymerElements/paper-ripple#^1.0.5",
> "paper-styles": "PolymerElements/paper-styles#^1.0.0",
> "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
> "iron-list": "PolymerElements/iron-list#^1.2.8"
>   },
>
> from:
>
> https://github.com/bendavis78/paper-date-picker
>
> Kind of hard to figure out what I need for the listbox...
>

I guess the html imports for the demo of the listbox gives me some clue:

  

  
  
  
  

from: 

https://github.com/PolymerElements/paper-listbox/blob/master/demo/index.html

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote:
>
> Polymers do not work like that. 
> For optimizing the size, see the links I posted in the previous comment. 
>
> I have a personal exploration of polymer that tried to minimize the output:
> https://github.com/pdamoc/polymer-exploration
>

First hurdle, there is no polymer-paper-listbox bower package, so I guess I 
need to create one? Are all these bower dependencies really needed to build 
a functioning date picker?

  "dependencies": {
"moment-element": "bendavis78/moment-element#^1.1.1",
"polymer": "Polymer/polymer#^1.1.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.7",
"iron-iconset-svg": "PolymerElements/iron-iconset-svg#^1.0.9",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^1.0.0",
"iron-resizable": "PolymerElements/iron-resizable-behavior#^1.0.0",
"iron-selector": "PolymerElements/iron-selector#^1.0.0",
"neon-animation": "PolymerElements/neon-animation#^1.0.0",
"paper-ripple": "PolymerElements/paper-ripple#^1.0.5",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
"iron-list": "PolymerElements/iron-list#^1.2.8"
  },

from:

https://github.com/bendavis78/paper-date-picker

Kind of hard to figure out what I need for the listbox...

-- 
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: Which text editor do you prefer for Elm?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, August 10, 2016 at 11:47:34 AM UTC+1, Rupert Smith wrote:
>
> I'm trying the Elm emacs mode, but it is pretty bad. If I select and 
> indent a whole file for example all the import statements and statements 
> within a let .. in get indented +1 more level as you go down the list. 
> Sometimes it crashes and busy spins Emacs too.
>
> Something better would be appreciated. :-)
>

I'm using Atom now, elmjutsu seems ok, the linter-elm-make is working now 
but quite slow, so I use it only occasionally. Atom seems a little flaky, 
needs to be restarted now and again. Hopefully it will improve because it 
generally seems to work quite well. 

-- 
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: Which text editor do you prefer for Elm?

2016-10-05 Thread Kristo Koert
I use spacemacs with the Elm layer 
https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/elm 

Works very well for me, and pretty easy to set up. I also tried tried these 
editors before settling on spacemacs:

Sublime Text Plugin (Abandoned and missing some features)
Atom (Too slow for me, elm-format on save cause visible flickering of the 
code highlighting)
IntelliJ (Was too incomplete)

At one point in Sublime I build a decent sized Elm application, all the 
while not even realising that code highlighting was broken (worked for just 
some keywords). Elms syntax is IMHO very simple and the compiler is so 
helpful that fancy features might not be so important. Just my 2c. Wouldn't 
hurt though.

NOTE: I use spacemacs just as a preset for emacs, don't even know vim.

On Wednesday, August 10, 2016 at 1:47:34 PM UTC+3, Rupert Smith wrote:
>
> I'm trying the Elm emacs mode, but it is pretty bad. If I select and 
> indent a whole file for example all the import statements and statements 
> within a let .. in get indented +1 more level as you go down the list. 
> Sometimes it crashes and busy spins Emacs too.
>
> Something better would be appreciated. :-)
>

-- 
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: Is over-use of 'let... in' considered an anti-pattern?

2016-10-05 Thread Simone Vittori
I agree with everything said, however there's a specific case where I 
personally try to avoid `let` if possible.

Sometimes view functions can be quite big, hence it makes sense to split 
them into smaller composable functions.

So far so good, but as soon as we introduce the `let ... in` block, the 
diff will be worthless (as pointed in the style guide 
, producing clean diffs is one of the 
goals).

So in these cases I think it's best to add new functions at the bottom 
instead. 

As an example, instead of:

view model =
let
viewFoo =
...

viewBar =
...

viewBaz =
...
in
div []
[ viewFoo
, viewBar
, viewBaz
]




I'd rather go for:

view model =
div []
[ viewFoo model
, viewBar model
, viewBaz model
]

viewFoo model =
...

viewBar model =
...

viewBaz model =
...


However this is just my opinion and I don't feel like I have to strictly 
follow this convention. It may depend from case to case and having a dirty 
diff doesn't really matter in the end.


On Tuesday, 4 October 2016 21:04:31 UTC+1, Andrew Radford wrote:
>
> I've been trying out Elm, and although I have a little functional 
> programming experience from F#, mostly I have used OO languages. With my 
> experiments in Elm, I have found sometimes I end up with something like this
>
> foofunction model = 
>   let 
> something = foo bar baz
> somethingElse = foo bar baz
> yetMoreStuff = foo qux thud
>   in
>{ model 
>   | fieldA = something
>   , fieldB = somethingElse
>   , fieldC = yetMoreStuff
> }
>
>
> ... anyway I hope you get the idea. A style of function which lot of lines 
> in the 'let' block before generally one final thing in the 'in' block. In 
> F#, this sort of thing didn't look so bad as the stuff in the let block 
> would be all applied with individual 'let' functions. However in Elm they 
> start to *resemble *OO/imperitive style variable assignments, which makes 
> me question whether this is the Right Thing to do, or would it be 
> considered stylistically better to do something else, like for eg chain the 
> model through individual updating functions using '|>'.  Any strong 
> opinions about this? Have not seen too much about it in the style guides 
> etc that I have encountered
>
> Andrew
>  
>
>

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread Peter Damoc
Polymers do not work like that.
For optimizing the size, see the links I posted in the previous comment.

I have a personal exploration of polymer that tried to minimize the output:
https://github.com/pdamoc/polymer-exploration



On Wed, Oct 5, 2016 at 2:01 PM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

>
>
> On Wednesday, October 5, 2016 at 11:44:35 AM UTC+1, Rupert Smith wrote:
>>
>> On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski
>> wrote:
>>>
>>> I took Peter’s gist as a basis and made a repo out of it:
>>> https://github.com/fredcy/elm-polymer-calendar
>>>
>> I am going to give this a go, as I need an MDL styles multi-select:
>>
>> https://elements.polymer-project.org/elements/paper-listbox?
>> view=demo:demo/index.html=paper-listbox
>>
>> Should be easy enough following your calendar demo.
>>
>
> Also, on the code size issue, presumably all the polymer components are
> hosted on googles CDN? In which case once a particular version has been
> downloaded once there is a good chance users may already have it cached.
> Only the first load of your app will be bloated.
>
> --
> 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] Re: Integrating Elm with Web Components / Polymer

2016-10-05 Thread Peter Damoc
For what is worth, the approach described here:
https://github.com/Polymer/polycasts/tree/master/ep39-vulcanize/vulcanized-app
https://www.youtube.com/watch?v=EUZWE8EZ0IU=PLOU2XLYxmsII5c3Mgw6fNYCzaWrsM3sMN=16
might provide some more ideas.



On Wed, Oct 5, 2016 at 1:44 PM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski
> wrote:
>>
>> I took Peter’s gist as a basis and made a repo out of it:
>> https://github.com/fredcy/elm-polymer-calendar
>>
> I am going to give this a go, as I need an MDL styles multi-select:
>
> https://elements.polymer-project.org/elements/paper-
> listbox?view=demo:demo/index.html=paper-listbox
>
> Should be easy enough following your calendar demo.
>
> --
> 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] Re: Integrating Elm with Web Components / Polymer

2016-10-05 Thread John Mayer
If I'm reading this right, you may be able to get just the polyfills.

http://webcomponents.org/polyfills/

On Oct 5, 2016 7:01 AM, "'Rupert Smith' via Elm Discuss" <
elm-discuss@googlegroups.com> wrote:

>
>
> On Wednesday, October 5, 2016 at 11:44:35 AM UTC+1, Rupert Smith wrote:
>>
>> On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski
>> wrote:
>>>
>>> I took Peter’s gist as a basis and made a repo out of it:
>>> https://github.com/fredcy/elm-polymer-calendar
>>>
>> I am going to give this a go, as I need an MDL styles multi-select:
>>
>> https://elements.polymer-project.org/elements/paper-listbox?
>> view=demo:demo/index.html=paper-listbox
>>
>> Should be easy enough following your calendar demo.
>>
>
> Also, on the code size issue, presumably all the polymer components are
> hosted on googles CDN? In which case once a particular version has been
> downloaded once there is a good chance users may already have it cached.
> Only the first load of your app will be bloated.
>
> --
> 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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss


On Wednesday, October 5, 2016 at 11:44:35 AM UTC+1, Rupert Smith wrote:
>
> On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski 
> wrote:
>>
>> I took Peter’s gist as a basis and made a repo out of it: 
>> https://github.com/fredcy/elm-polymer-calendar
>>
> I am going to give this a go, as I need an MDL styles multi-select:
>
>
> https://elements.polymer-project.org/elements/paper-listbox?view=demo:demo/index.html=paper-listbox
>
> Should be easy enough following your calendar demo.
>

Also, on the code size issue, presumably all the polymer components are 
hosted on googles CDN? In which case once a particular version has been 
downloaded once there is a good chance users may already have it cached. 
Only the first load of your app will be bloated.

-- 
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: keeping functions out of the model

2016-10-05 Thread Mark Hamburg
On Oct 5, 2016, at 5:22 AM, Noah Hall  wrote:
> 
> It makes it hard to perform eq on.

This is the big one from my standpoint. To optimize lazy views (and memory/gc 
behavior), I've at times written "smart" update functions that check for 
equality with existing values before constructing new values. This then started 
blowing up with a runtime exception caused by comparing functions for equality. 
Now, I'm paranoid and both avoid functions in models and equality comparisons 
because someone else may not have exhibited one or the other of these forms of 
caution.

It would be nice if Elm would treat functions that aren't obviously equal as 
unequal but I recognize that this could lead to compiler optimizations changing 
the behavior of programs which isn't great either.

Mark

-- 
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: Integrating Elm with Web Components / Polymer

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski 
wrote:
>
> I took Peter’s gist as a basis and made a repo out of it: 
> https://github.com/fredcy/elm-polymer-calendar
>
I am going to give this a go, as I need an MDL styles multi-select:

https://elements.polymer-project.org/elements/paper-listbox?view=demo:demo/index.html=paper-listbox

Should be easy enough following your calendar demo.

-- 
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: Teaching children Elm

2016-10-05 Thread Will White
Knowing (ahead of time) if there's someone in the class with a good idea 
for an application would be gold.

On Tuesday, October 4, 2016 at 6:33:04 AM UTC+1, Fedor Nezhivoi wrote:
>
> Hello folks,
>
>
> Evan, Richard and the whole community as well as Elm language itself do a 
> great job in teaching community. If you are staying with this community for 
> a long time, you probably already can notice some improvements in your 
> understanding of programming, API design, abstractions and etc. How can we 
> take it even further?
>
>
> Recently I got an opportunity to share some knowledge about functional 
> programming and programming in general. However target audience are 
> children (mostly 14-16 y.o.) and I am a little bit stuck. Not only I've 
> never been a teacher, but with children I expect it to be even harder 
> because of curse of knowledge. On the other hand trying to teach some 
> boring basics doesn't feel right, to be interesting it should be kind of 
> journey.
>
>
> Previously there was some information about courses in USA where children 
> are thought programming with Elm. So I am kindly ask people who are doing 
> this to share your experience, tips, tricks and whatever may be helpful. It 
> would be even better if you can share some actual 
> content/topics/lessons/exercises. If you know exact person, but they are 
> not here, please, provide me with contacts.
>
>
> *I am kindly ask you to abstain from discussions and only participate if 
> you have something concrete.*
>
>
> Have a nice day!
>

-- 
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: How to decode a recursive JSON from a port?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss


On Wednesday, October 5, 2016 at 11:40:24 AM UTC+1, Rupert Smith wrote:
>
> On Wednesday, October 5, 2016 at 11:15:13 AM UTC+1, Wil C wrote:
>>
>> Hi all,
>>
>> Thanks again for all your help. And when I've asked questions last year.
>>
>> I have another question. Here's my situation. I want to pass a json from 
>> a port, and decode the json into records. 
>>
>> The recursive record:
>>
>> type alias Node = {
>>> name : String
>>>   , children : Children
>>>   }
>>>
>>> type Children =
>>>   Children (List Node)
>>
>>
> I wonder if you will ever get this to work? I tried passing a union type 
> to a port but the compiler complained that the type was not compatible with 
> ports, it would only work with the record type. 
>

Sorry, just ignore. I think you are trying to encode/decode explicitly to a 
string in order to be able to use this data with a port. 

-- 
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: How to decode a recursive JSON from a port?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, October 5, 2016 at 11:15:13 AM UTC+1, Wil C wrote:
>
> Hi all,
>
> Thanks again for all your help. And when I've asked questions last year.
>
> I have another question. Here's my situation. I want to pass a json from a 
> port, and decode the json into records. 
>
> The recursive record:
>
> type alias Node = {
>> name : String
>>   , children : Children
>>   }
>>
>> type Children =
>>   Children (List Node)
>
>
I wonder if you will ever get this to work? I tried passing a union type to 
a port but the compiler complained that the type was not compatible with 
ports, it would only work with the record type. 

-- 
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] How to decode a recursive JSON from a port?

2016-10-05 Thread Wil C
Hi all,

Thanks again for all your help. And when I've asked questions last year.

I have another question. Here's my situation. I want to pass a json from a 
port, and decode the json into records. 

My port:

port parseSuccess : (Json.Encode.Value -> msg) -> Sub msg


When calling it:

app.ports.parseSuccess.send(JSON.stringify(cst.toAst()))

The recursive record:

type alias Node = {
> name : String
>   , children : Children
>   }
>
> type Children =
>   Children (List Node)


The fromJson to decode the Json.

fromJson : Json.Value -> Result String Node
> fromJson json =
> Json.decodeValue nodeDecoder json
>

My decoders:

nodeDecoder : Decoder Node
> nodeDecoder =
>   object2 Node
> ("name" := string)
> ("children" := childrenDecoder )
>
 

childrenDecoder : Decoder Children
> childrenDecoder =
>   customDecoder
> (Json.list nodeDecoder)
> (\children -> Result.Ok <| Children children)


When I run it, I get an error in the Result in "fromJson"
: Err "Expecting an object with a field named `name` but instead got: 
\"{\\\"name\\\":\\\"WhereClause\\\",\\\"children\\\":[{\\\"name\\\":\\\"ComparisonPredicate\\\",\\\"children\\\":[\\\"age\\\",{\\\"name\\\":\\\"ComparisonPredicatePart2\\\",\\\"children\\\":[\\\"<\\\",\\\"10\\\"]}]}]}\""

What's the difference between Json.Encoder.Value and a String? When I'm 
calling the port on the JS side, I'm sending a string from 
JSON.stringify(). It seems like it comes in as Json.Encoder.Value as the 
type, but according to the error, it seems like it's coming in as a string. 
What am I doing wrong?

Wil


-- 
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: A convenience pattern around Http?

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 4, 2016 at 5:54:01 PM UTC+1, Kasey Speakman wrote:
>
> Seems like this is trying to normalize operations to CRUD. I would be 
> careful of over-standardizing early. Because later you will likely have to 
> break those abstractions to implement new features. For example, the way I 
> would implement a Customer merge would not fit semantically into one of 
> those operations.
>

Yes, what I am doing is using codegen + a data model to create a starting 
point for a service. You get CRUD plus finders to get things started. I 
also codegened a client in Elm, again giving me CRUD plus finders on the 
client side.

I then add new operations or remove ones that I don't want by hand. It is 
over standardizing but it is also incredibly useful and helps me get things 
up and running very fast. Find by example is particularly useful in the 
early stages of a project, as it can generate a good range of queries with 
little effort.

Eventually I will add more flexibility to the codegen to let me select 
which operations out of CRUD plus finders I actually want to generate plus 
any other useful standard operations I can think of. Also better modelling 
of custom operations that are hand coded, such that the codegened client 
does not also need those added by hand but can always be automatically made 
to fully match the server side API.

So for the purposes of this thread, don't get too hung up on the over 
standardized API. What is interesting from the point of view of Elm is how 
I have wrapped up the REST operations in a module and tried to minimize the 
amount of boilerplate needed to use them.

===

One thing I will have to change is the error handling. I need to know if 
individual operations fail and how - for example, when doing a create if 
the entity to create fails server side validation I need to know that and 
also get some errors from the server and be able to render those in the UI.

I think a catch-all error hander is still useful, perhaps I will try and 
set things up so the error goes to an endpoint specific handler first, and 
then on to the catch all if the specific handler does not process it.

-- 
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] What's the convention for modules with more than one word?

2016-10-05 Thread Wil C
Ah, thanks.

On Thursday, September 29, 2016 at 1:10:04 PM UTC-7, Joey Eremondi wrote:
>
> CamelCase in both cases. The file names usually exactly match the module 
> name, with .elm added.
>
> On Thu, Sep 29, 2016 at 1:08 PM, Wil C  
> wrote:
>
>> Oddly enough, for the stuff I've written in elm, I've not had to name a 
>> multi-word module.
>>
>> What's the naming convention for multi-word modules? Is it CamelCase for 
>> the module name, but snake_case for the file name? I can't seem to find an 
>> example.
>>
>> Wil
>>
>> -- 
>> 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.


[elm-discuss] Underscores now allowed in repository URL.

2016-10-05 Thread 'Rupert Smith' via Elm Discuss
I have this repo URL in my elm-package.json

"repository": "https://github.com/rupertlssmith/thesett_style_lab.git;,

But elm refuses to compile with that complaining about the underscores.

Is is possible to override the package owner and name explicitly, rather 
than trying to extract them from the github URL?

What if I don't even use github?

-- 
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: keeping functions out of the model

2016-10-05 Thread Zinggi
This also has the added benefit that you can then use the same animation 
with different easing functions without having to duplicate the whole 
Animation record.

On Wednesday, 5 October 2016 10:01:25 UTC+2, Zinggi wrote:
>
> I think you could create an animation library that doesn't store any 
> functions in its model and still be able to let a user provide whatever 
> easing function they want.
>
> E.g. remove the ease key from your AnimRecord and let all functions that 
> currently take an Animation have an additional parameter easingFunction:
>
> animate : EasingFunction -> Time -> Animation -> Float
>
> This way a user of your library doesn't have to put any functions in their 
> model and you get both a function free model and endless customization by 
> providing whatever easing function a user needs.
>
> Am I missing something?
>
>
> On Wednesday, 5 October 2016 07:56:04 UTC+2, Max Goldstein wrote:
>>
>> Serialization: animations are view state. They can safely be left out of 
>> a serialized and persisted model.
>>
>> Print out the model: True, but if you're using animation in an app, 
>> you're beyond poking at the model in the REPL.
>>
>> Harder to equate: My animation library provides an "equals" function. In 
>> addition to sampling the easing function, it accounts for a few other ways 
>> animations can have different representations but be considered equal (e.g. 
>> start at time t with delay k == start at time t+k with no delay).
>>
>> "just store the things needed to create the function" -> This is 
>> essentially the "EasingDescription" idea I talked about above. The problem 
>> is that easing functions can be created in many way (sinusoids, 
>> polynomials, exponentials, bounces) and I want to allow the client to 
>> specify any function.
>>
>

-- 
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: keeping functions out of the model

2016-10-05 Thread Zinggi
I think you could create an animation library that doesn't store any 
functions in its model and still be able to let a user provide whatever 
easing function they want.

E.g. remove the ease key from your AnimRecord and let all functions that 
currently take an Animation have an additional parameter easingFunction:

animate : EasingFunction -> Time -> Animation -> Float

This way a user of your library doesn't have to put any functions in their 
model and you get both a function free model and endless customization by 
providing whatever easing function a user needs.

Am I missing something?


On Wednesday, 5 October 2016 07:56:04 UTC+2, Max Goldstein wrote:
>
> Serialization: animations are view state. They can safely be left out of a 
> serialized and persisted model.
>
> Print out the model: True, but if you're using animation in an app, you're 
> beyond poking at the model in the REPL.
>
> Harder to equate: My animation library provides an "equals" function. In 
> addition to sampling the easing function, it accounts for a few other ways 
> animations can have different representations but be considered equal (e.g. 
> start at time t with delay k == start at time t+k with no delay).
>
> "just store the things needed to create the function" -> This is 
> essentially the "EasingDescription" idea I talked about above. The problem 
> is that easing functions can be created in many way (sinusoids, 
> polynomials, exponentials, bounces) and I want to allow the client to 
> specify any function.
>

-- 
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.