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 anti-pattern in java? How is this a good thing? It seems
like a step backwards.

Often there is no way to "handle" the error. There is no sensible default.
It's a programmer error and throwing an exception is the most logical thing
to do.

Unless I am missing some key concept, this will make your programs less
reliable. True, there will be no runtime exception. But there will be bugs.
And more noise.

Again, I will admit that I am new to Elm. And may be missing something. I
totally get the whole "maybe" thing. And I see the advantage of that.

But, if I am not mistaken, we are back to C in the sense of "no throw"? C#,
Java, JavaScript, and Scala have the keyword throw. VisualBasic, Python,
Ruby, F# and Clojure have raise.

Is there no throw/raise in Elm? We must use "return" for both standard
return and error return. Is that correct?

I'm not trying to be a troll. There are lots of things I love about Elm.
I'm just trying to understand the language. 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to