[Haskell-cafe] MultiCase alternative
Bardur Arantsson
spam at scientician.net
Thu Jun 15 14:31:19 UTC 2017
On 2017-06-15 16:11, Baa wrote:
> Hello, Everyone!
>
> As I understand "MultiCase" proposal was not approved, so my question
> is: is there alternatives to multi-case? I have code like:
>
> case x of
> A a -> ..
> B b -> ..
> C c -> --same--
> D c -> --same--
>
> and I want to merge code of "C c" with "D c" branch. Anywhere, in
> general: is any alternatives to make "OR"s in patterns? I don't see how
> to do it with pattern guards, pattern synonyms, views extensions and
> don't see another related extensions.
>
Create a function.
Regards,
More information about the Haskell-Cafe
mailing list