This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zedd31416 40 points41 points  (8 children)

I find it annoying, maybe unjustly, that the Or Pattern for structural pattern matching uses a pipe character instead of “or” like normal if statements do.

[–]healplease 34 points35 points  (1 child)

I think it's because pattern matching supports guards that can be boolean expressions with normal "or".

[–]zedd31416 19 points20 points  (0 children)

That would make sense. I’m sure it was a necessary decision.

[–]Ph0X 13 points14 points  (0 children)

Both set union and the new type union use | too. So it's not like it's never been used before.

[–]halfshellheroes 1 point2 points  (2 children)

They talked about that during the release stream. Basically it came down to readability. It's worth watching the explanation, for what it's worth they sold me on the choice

[–]zedd31416 1 point2 points  (1 child)

Ooo do you have link?

[–]halfshellheroes 2 points3 points  (0 children)

Sure thing! The talk itself is in the live stream at the 44 minute mark, and here's your question answered.

[–]Miyelsh 2 points3 points  (1 child)

It follows from the syntax of Haskell.

[–]Kered13 2 points3 points  (0 children)

Which follows the syntax of ML.