Greenwashing
Meta
jared771 at gmail.com
Fri May 29 20:55:59 UTC 2020
On Friday, 29 May 2020 at 20:02:37 UTC, Timon Gehr wrote:
> On 29.05.20 14:40, Meta wrote:
>> On Friday, 29 May 2020 at 08:52:14 UTC, Timon Gehr wrote:
>>>> I find that response surprising, given that you used to use
>>>> Haskell (do you still?), which gets along fine without
>>>> exceptions.
>>>
>>> http://hackage.haskell.org/package/base-4.14.0.0/docs/Control-Exception.html
>>>
>>>
>>> Furthermore, imperative-style code in Haskell is based on
>>> monads, which are a generalization of exceptions.
>>
>> I'm going to step up the pedantry and say that this proves my
>> assertion; Haskell (the language) gets along fine without
>> exceptions, but they're there for you to use as a library,
>> only if you want to.
>
> Prelude> case (1,1) of (2,2) -> 0
> *** Exception: <interactive>:4:1-24: Non-exhaustive patterns in
> case
Okay, I'll concede that one. I forgot that non-exhaustive
patterns throw exceptions; I thought I remembered them raising
errors.
Let's talk about Rust instead, then, which 100% absolutely does
not have exceptions. They seem to make do with Option/Result/try
(though I guess since they're monads you'd consider those
equivalent to exceptions, but they don't behave like exceptions
as they're just sugar over pattern matching).
More information about the Digitalmars-d
mailing list