|
![](/i/fill.gif) |
On 17/10/2015 01:45 PM, Orchid Win7 v1 wrote:
> Well, it turns out you can have *multiple guards* on a single expression!
>
> case list of
> [x, y, z] | x > 0, y > 0, z > 0 -> ...
>
> What does that even *do*?! <read the spec/> OK, so it seems it's the
> logical-AND of all the conditions? So, um, why not just write it as an AND?
I've been a Haskell programmer for [at least] 10 years, and I've never
seen *anybody* do this!
...it turns out there's a reason for that. This is actually a *new*
language feature, added in the Haskell 2010 specification.
Let me say that again: Somebody thought this was a *good* idea. They
actually *added* this. On purpose.
So while the Haskell 2010 spec removed the much-hated N+K patterns
misfeature, they've added something arguably even worse as well. <sigh>
Post a reply to this message
|
![](/i/fill.gif) |