
24 Jan
2022
24 Jan
'22
4:28 p.m.
I don't think that can be the reason. It is possible to have a single clause with multiple guards: bar | False = () | True = () It's just not possible to have multiple clauses if one of them is guarded, apparently. On Mon, Jan 24, 2022 at 04:24:43PM -0500, Brandon Allbery wrote:
I think because it desugars to a case-of and there's nothing to case on in the first one?
On Mon, Jan 24, 2022 at 4:18 PM Tom Ellis
wrote: According to GHC there are multiple declarations of bar, but not of foo. I don't understand. Why is it not valid to have multiple clauses for a variable binding?
Tom
bar | False = () bar = ()
foo _ | False = () foo _ = ()