On Sunday, February 19, 2017 at 12:09:18 AM UTC, Alex Barry wrote:
>
> But that if statement would only go around something doing integer 
> division, where the divisor could be zero. What you're suggesting would be 
> required for at least all integer division, and potentially a pattern for 
> other integer operations. That's a huge impact.
>

Good point.

divideByFive x = x // 5 -- I know 5 is not zero.

Elm does have runtime exceptions then. It seems like a bug that // 0 give 
0, the point of the type system is to help eliminate errors, but this just 
lets an error slip through potentially un-noticed.

Would it not be better to make // 0 equivalent to Debug.crash "divide by 
zero"?

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

Reply via email to