Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Max Goldstein
Yes, Result is worth looking at. It's like Maybe, except the error case can carry some information too (usually a string). Task is used for asynchronous effects (e.g. HTTP requests) which often can fail in odd ways. I'd focus on Result for now, as all the tooling I'm about to mention is the

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Ambrose Laing
Elm has datatypes called Maybe, Result and Task. You mentioned Maybe already, which may be understood to mean a list of at most one item, or a data type with either missing data, or an unspecified error. Result allows you to specify the error and propagate it, so take a look at that. Then

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Dave Ford
Duane. Don't get me wrong. I prefer compile errors over runtime errors. And if Elm can catch more errors at compile time without adding a bunch of noise to my code that is a good thing obviously. But runtime errors are unavoidable. It's not possible for the compiler to catch every possible error

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Duane Johnson
On Thu, Oct 6, 2016 at 8:13 PM, Dave Ford wrote: > 2. *Runtime Exception. *Like a NullPointerException or an > IllegalArgumentException. I *love* these kind of bugs. Super easy to > find. Super easy to fix. A stack trace tells me exactly where to look. > These kind of

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Dave Ford
Thanks Joey. > you will handle the error case, and either come up with a sensible > default, or tell your program to display some error message, or do > something else to properly handle the error. > You mean, do exactly like I showed in the java newbie example? What would be considered an

[elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread Aislan de Sousa Maia
I've heard scary things about Polymer performance, mainly on mobile browsers. What you guys think about the state of Polymer at this time? -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails

[elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Dave Ford
I have listened to a number of podcasts where Richard Feldman boasts about never getting a runtime exception. I am having a hard time grasping the concept. I think I look at runtime exceptions a bit differently. I look at them as a *positive*. A programmers tool. A debugging tool. A way to

[elm-discuss] Making tangram logos

2016-10-06 Thread Aaron VonderHaar
For anyone who's been wanting an easy way to make nice-looking tangram logos for their own Elm projects, I did a short livestream last week where I made a small Elm module with some nice helper functions for quickly assembling SVG tangram shapes. Code is here:

[elm-discuss] Re: Installing Elm Packages while Offline

2016-10-06 Thread Aislan de Sousa Maia
It should be great if this installing tool was like the rails's bundle command tool. Just have the packages downloaded into a local location, and when you need this stuffs installed, get through your own already installed packages with the installing tool. No necessary to copy and past from a

[elm-discuss] Re: Functional programming, or why should I use Elm instead of vanilla javaScript?

2016-10-06 Thread Zinggi
> And all this stuff about immutability, can be easily achieved in plain javaScript. You claim that you can achieve all the the things that elm does by being disciplined enough, but that's not true. Here are a few things that only elm can provide that JavaScript can't. These things are only

Re: [elm-discuss] How to interpret missing fields as Nothing in ports?

2016-10-06 Thread Aaron VonderHaar
At NoRedInk, if we are passing complex data through a port, we generally pass it as `Json.Value`, and then use a JSON decoder in Elm to transform it into the appropriate type. That way, you can write a decoder to handle missing fields in whatever way you'd like. On Thu, Oct 6, 2016 at 11:18 AM,

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 3:54:02 PM UTC+1, Peter Damoc wrote: > > Next challenge: how to implement Custom Elements in Elm. :) > > These examples cover a variety of different ways of working with elm and polymer together: https://github.com/kevinlebrun/elm-polymer This one, I think, is a

[elm-discuss] Has anyone integrated Elm into a Web Forms project?

2016-10-06 Thread Kasey Speakman
I have a legacy project that needs a new page. I'm just trying to figure out the logistics of getting Elm to work with the existing (full) Visual Studio project. If someone has done that already, I would greatly appreciate hearing your experiences. -- You received this message because you are

[elm-discuss] How to interpret missing fields as Nothing in ports?

2016-10-06 Thread Ed Ilyin
Hi, When you send record with Maybe fields to a port - Nothing values are converted to nulls. When you send json with null properties to firebase - firebase removes such properties (by design) When you try to receive record from port - how to force Elm to interpret missing fields as Nothing?

Re: [elm-discuss] Installing Elm Packages while Offline

2016-10-06 Thread Aaron VonderHaar
Yes, you can just copy the relevant packages in the `./elm-stuff/packages/` folders of your projects. On Thu, Oct 6, 2016 at 9:36 AM, Duane Johnson wrote: > I'll be taking a long flight tomorrow and I'm curious if there's an easy > way to install packages without the

Re: [elm-discuss] Problem with beginnerProgram

2016-10-06 Thread Aaron VonderHaar
Hello, The error is saying that your view is producing messages that are functions. This is because your `onClick` is using `UpdateModel`, but `UpdateModel` itself is not a message: `UpdateModel` needs a String value to become a Msg. Possible fixes would be: 1) Change UpdateModel to not take

Re: [elm-discuss] Problem with beginnerProgram

2016-10-06 Thread Duane Johnson
Right here, you're saying that the UpdateModel type takes a String: > type Msg = UpdateModel String > > update: Msg -> String -> String > update action model = > case action of > UpdateModel newModel -> > newModel > > view: String -> Html a > view model = > div[] > [ >

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

2016-10-06 Thread Dave Thomas
Im pretty much using VSCode for everything in Elm, with some occasional use of LightTable with the elm-light plugin which is very nice too. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails

Re: [elm-discuss] Re: Functional programming, or why should I use Elm instead of vanilla javaScript?

2016-10-06 Thread Joey Eremondi
You can get good code without Elm's type system, but what you won't get is a compiler as an assistant. Made a small typo? The compiler tells you. Mixed up the first and second arguments to a function? Usually a type error, so the compiler tells you. Most importantly, refactoring becomes easy.

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread Peter Damoc
Next challenge: how to implement Custom Elements in Elm. :) On Thu, Oct 6, 2016 at 5:42 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > On Thursday, October 6, 2016 at 12:23:53 PM UTC+1, Peter Damoc wrote: >> >> This works for me in both Chrome and Firefox on OS X

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 12:23:53 PM UTC+1, Peter Damoc wrote: > > This works for me in both Chrome and Firefox on OS X with > the 'webcomponents-lite.js' > > Thanks for solving this. > After some poking around and a severe lack of documentation on the part of Polymer, I have managed

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread Peter Damoc
This works for me in both Chrome and Firefox on OS X with the 'webcomponents-lite.js' Thanks for solving this. On Thu, Oct 6, 2016 at 2:11 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > On Thursday, October 6, 2016 at 12:07:15 PM UTC+1, Rupert Smith wrote: >> >>

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 12:07:15 PM UTC+1, Rupert Smith wrote: > > On Thursday, October 6, 2016 at 11:50:01 AM UTC+1, Rupert Smith wrote: >> >> On Thursday, October 6, 2016 at 11:14:46 AM UTC+1, Peter Damoc wrote: >>> >>> Custom elements also work decently when the custom element takes no

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 11:50:01 AM UTC+1, Rupert Smith wrote: > > On Thursday, October 6, 2016 at 11:14:46 AM UTC+1, Peter Damoc wrote: >> >> Custom elements also work decently when the custom element takes no >> children but if it does, it stops working. >> > > Rendering of keyed nodes

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 6, 2016 at 11:14:46 AM UTC+1, Peter Damoc wrote: > > Custom elements also work decently when the custom element takes no > children but if it does, it stops working. > Rendering of keyed nodes in the vdom is here:

[elm-discuss] Re: Teaching children Elm

2016-10-06 Thread Will White
I've been thinking about how I'll give a talk about Elm (at a JS event in Nottingham, UK). To demonstrate Model-Update-View, I think I'll start with the Counter example, but instead of in code, in real life. So I'd say "I'm a counter, I'm on 0. Increment and Decrement me." and end up with a

Re: [elm-discuss] Re: Integrating Elm with Web Components / Polymer

2016-10-06 Thread Peter Damoc
I would love some insights from the people who have a better understanding of what might be happening here. The custom elements interface looks amazing in theory. Custom elements also work decently when the custom element takes no children but if it does, it stops working. I tried it with

Re: [elm-discuss] Functional programming, or why should I use Elm instead of vanilla javaScript?

2016-10-06 Thread Wouter In t Velt
This react-conf 2016 video on Elm (which was when I first heard of Elm) is a great explanation of the many things which are possible in javascript, but not necesserily good. Javascript is like an irresponsible parent. You can do pretty much

Re: [elm-discuss] Functional programming, or why should I use Elm instead of vanilla javaScript?

2016-10-06 Thread Zachary Kessin
*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.