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

2016-10-07 Thread Joey Eremondi
Do not use Either. The Result type in the standard library is the same, but with the names more intuitive. On Oct 7, 2016 11:58 PM, "Arthur Welf" wrote: > If you want error messages, you can use type Either: > > type Either a b > = Left a > | Right b > > You define the set of values which are ac

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

2016-10-07 Thread Arthur Welf
If you want error messages, you can use type Either: type Either a b = Left a | Right b You define the set of values which are acceptable as arguments by your function, and they will be executed in the Right branch. Every time your function receives an unacceptable argument, it goes to the

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

2016-10-07 Thread Peter Damoc
On Fri, Oct 7, 2016 at 11:02 PM, Dave Ford wrote: > On Fri, Oct 7, 2016 at 11:10 AM, Peter Damoc wrote: >> >> If you can come up with a practical scenario where you would have an >> exception, I or someone else around here could tell you what would happen >> in Elm in that context. >> > Yes. The

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

2016-10-07 Thread Dave Ford
On Fri, Oct 7, 2016 at 11:33 AM, Kasey Speakman wrote: > > Then at the edge of the application, I can deal with the errors > Yes. This is what I am trying to figure out. How to deal with that class of errors at the "edge". Thanks. -- You received this message because you are subscribed to the G

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

2016-10-07 Thread Dave Ford
On Fri, Oct 7, 2016 at 11:10 AM, Peter Damoc wrote: > > If you can come up with a practical scenario where you would have an > exception, I or someone else around here could tell you what would happen > in Elm in that context. > Yes. The example I gave when I started the thread (sorry for the java

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

2016-10-07 Thread Dave Ford
On Fri, Oct 7, 2016 at 10:14 AM, Joey Eremondi wrote: > Runtime exceptions are inevitable > > You can keep saying it, but it doesn't make it true. > Sorry. I was using the term "runtime exception" in the more general sense: exceptional conditions that occur at runtime (not caught by the compiler

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

2016-10-07 Thread Kasey Speakman
Hi Dave. Check out this link , but scroll down to the section titled "Should functions throw exceptions or return error structures?". It's F#, but the comparison is valid to exception handling vs "functional" error handling using Maybe (Optio

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

2016-10-07 Thread Peter Damoc
On Fri, Oct 7, 2016 at 8:08 PM, Dave Ford wrote: > > But exception bubbling is a *feature*. An extremely useful feature. > Language level support for exceptions has been a staple of every > programming language since C. I do not consider Maybe and Result to be a > useful substitute for language le

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

2016-10-07 Thread Max Goldstein
Part of what makes runtime exceptions not inevitable is that many such errors come from I/O actions, which Elm handles with care. If you have a specific example of an inevitable runtime error, we'd like to hear it. Theoretically of course, Elm doesn't solve the halting problem and you can alwa

Re: [elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Noah Hall
This is a small thread. Don't get yourself bothered by it. Elm _will_ get negative press by the people who frequent r/haskell. Purescript is closer to "Haskell but for frontend that isn't as terrible as GHCJS/Fay" than Elm will ever be. And that's completely okay. Take a look at the state of Elm s

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

2016-10-07 Thread Joey Eremondi
> > Runtime exceptions are inevitable The successful applications written in Elm proves that they are not. You can keep saying it, but it doesn't make it true. This is a path that Rust is following as well, so it's not like we're the only people in the tech community with this attitude. I coul

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

2016-10-07 Thread Joey Eremondi
If you want Exception Bubbling like that, use Maybe.andThen or Result.andThen. These are exactly what they are for. You can bubble your exceptions as high as you like, but (1) that bubbling is always expressed in the type signature, and (2) there's always something that will catch it eventually, i

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

2016-10-07 Thread Dave Ford
> > This means that there is no exception that will bubble up unhandled at > runtime and crash your app. > Peter, I think you may be misunderstanding the intent of exception bubbling. The idea is not to have the exception bubble up to the top and crash your app. The idea is this. Suppose you have

Re: [elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Peter Damoc
There is, however, something to be said about making explicit the tradeoffs that Elm made. I would love to have some kind of reference that points to various tradeoffs made in the design of Elm and what they enabled. For example, I remember (maybe wrongly) reading that typeclass like features wer

Re: [elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Joey Eremondi
@Peter, I totally agree. What I was trying to prompt was people going there and saying "I made this with Elm". On Fri, Oct 7, 2016 at 9:39 AM, Peter Damoc wrote: > I took a look at the thread and felt that it is better to say nothing. > > A lot of the arguments around there look somewhat like t

Re: [elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Peter Damoc
I took a look at the thread and felt that it is better to say nothing. A lot of the arguments around there look somewhat like the discussions that were silenced by the move away from FRP. Elm is trying to be simple and easy to use by people coming from JS not from Haskell. If someone wants to sa

[elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Max Goldstein
Counterpoint: r/haskell is not our target audience. Counter-counterpoint: Plenty of other people could find that thread from google. -- 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

[elm-discuss] Elm could use some positive stories on Reddit

2016-10-07 Thread Joey Eremondi
There's a "PureScript vs Elm" thread going on on the Haskell Reddit right now: https://www.reddit.com/r/haskell/comments/569cax/factors_going_to_elm_purescript_selection/ Elm's getting a lot of negative press. I certainly don't want to start a flamewar, but I think it would be helpful it people w

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

2016-10-07 Thread 'Rupert Smith' via Elm Discuss
On Friday, October 7, 2016 at 3:00:17 PM UTC+1, Peter Damoc wrote: > > > On Fri, Oct 7, 2016 at 4:41 PM, 'Rupert Smith' via Elm Discuss < > elm-d...@googlegroups.com > wrote: > >> customelements.io is all built on top of Polymer is it? >> >> Well, I got carried away. :) > > Not all of those libra

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

2016-10-07 Thread Joel McCracken
I think your suspicions are largely right, and your concerns are valid. However: Not all exceptional situations are created equal. Some happen more frequently than others, and many are due to programming errors, where things just aren't "wired up correctly", and not all cases are handled. Elm'

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

2016-10-07 Thread Peter Damoc
On Fri, Oct 7, 2016 at 4:41 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > customelements.io is all built on top of Polymer is it? > > Well, I got carried away. :) Not all of those libraries rest on Polymer. A lot of them, however, do. :) -- There is NO FATE, we a

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

2016-10-07 Thread 'Rupert Smith' via Elm Discuss
On Friday, October 7, 2016 at 9:43:40 AM UTC+1, Peter Damoc wrote: > > Yes, we just need web-components, not polymer. Polymer is prividing some >> convenience to experiment with web components though. >> >>> Well... it's more than just convenience. If this gets really iron out > and Elm programme

Re: [elm-discuss] meaning of List.filter (String.contains lowerQuery << String.toLower << .name) people

2016-10-07 Thread Arthur Welf
Please note that function composition operators work only with unary functions (functions which take only 1 argument. If your function takes more than 1 argument, you have to partially apply it to make it unary. > 7 окт. 2016 г., в 14:38, Ambrose Laing написал(а): > > Also, for future refere

[elm-discuss] Re: meaning of List.filter (String.contains lowerQuery << String.toLower << .name) people

2016-10-07 Thread Ambrose Laing
Also, for future reference you can try looking at this page: http://package.elm-lang.org/packages/elm-lang/core/latest/ And type your search term into the search field on the right. It can make you more independent, though of course we're happy to help. On Friday, October 7, 2016 at 8:31:52 AM

[elm-discuss] Re: meaning of List.filter (String.contains lowerQuery << String.toLower << .name) people

2016-10-07 Thread Ambrose Laing
Hello, Please take a look at this: http://stackoverflow.com/questions/27441648/what-does-the-operator-mean-in-elm It is very well written and answers your question. Read the part about *function composition* and if it doesn't make sense immediately, then the rest of the page will be helpful.

Re: [elm-discuss] meaning of List.filter (String.contains lowerQuery << String.toLower << .name) people

2016-10-07 Thread Peter Damoc
`<<` is just a function that takes two functions and combines them. It's signature looks like this: (<<) : (b -> c) -> (a -> b) -> a -> c so, given a function that takes `a` and returns `b` and a function that takes `b` and returns `c`, produce a function that takes `a` and produces `c` In your

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

2016-10-07 Thread John Orford
what's the betting, typescript3 implements immutable data structures, and everyone will be cooing about them (like they are know with non-nullable types ; ) imo, immutability is the biggest missing feature in js... On Fri, 7 Oct 2016 at 00:06 Zinggi wrote: > > And all this stuff about immutabili

[elm-discuss] meaning of List.filter (String.contains lowerQuery << String.toLower << .name) people

2016-10-07 Thread António Ramos
hello can someone explain the meaning of << in List.filter (String.contains lowerQuery << String.toLower << .name) people Regards António -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails f

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

2016-10-07 Thread Peter Damoc
On Fri, Oct 7, 2016 at 11:30 AM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > How about taking this example, and using it as a polymer component within > an elm application? So elm inside polymer inside elm. Sharing the code > between the two elm parts, just with two sep

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

2016-10-07 Thread 'Rupert Smith' via Elm Discuss
On Friday, October 7, 2016 at 8:08:43 AM UTC+1, Peter Damoc wrote: > > I was thinking more in terms of having a way to define custom components > in Elm and then use them in Elm while avoiding to duplicate the runtime and > the rest of the core libraries. :) > Yes, so you can have internal stat

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

2016-10-07 Thread John Orford
+1 Peter Elm forces you to explicitly handle failures - whereas you in many other languages the use of exception handling is optional. this freaks some people out, because it's so deeply baked in, that they can miss it's there at all : ) On Fri, 7 Oct 2016 at 09:32 Peter Damoc wrote: > On Fri,

Re: [elm-discuss] What is canonical way to import CSS?

2016-10-07 Thread Peter Damoc
You can use the solution described in the FAQ http://faq.elm-community.org/#how-can-i-load-css-or-other-resources-in-elm-reactor but, as Aaron pointed out this introduces performance issues. On Fri, Oct 7, 2016 at 4:03 AM, Michael Hipp wrote: > Hello. Learning Elm. Very impressed with the work

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

2016-10-07 Thread Peter Damoc
On Fri, Oct 7, 2016 at 5:13 AM, Dave Ford wrote: > So, based on my understanding, the whole "no runtime exceptions" concept > is just not computing. > > But I am new to Elm. Surely I am misunderstanding something. Please tell > me what I am missing. > Programs will always have code that could ri

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

2016-10-07 Thread Peter Damoc
On Fri, Oct 7, 2016 at 6:06 AM, John Mayer wrote: > My view is that we don't need Polymer, just the web components standards. > If you're deploying to production, that may means that you may need to > serve browser poly-fills. > We don't even need the entire web-components standard, just the cus

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

2016-10-07 Thread Peter Damoc
I was thinking more in terms of having a way to define custom components in Elm and then use them in Elm while avoiding to duplicate the runtime and the rest of the core libraries. :) On Thu, Oct 6, 2016 at 11:32 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > On Th