[Haskell-cafe] MultiCase alternative
Bram Neijt
bneijt at gmail.com
Thu Jun 15 14:33:57 UTC 2017
Hi Paul,
I'm nit experienced in Haskell, so I don't have a solution. But the
following keywords spring to mind:
Ignore the syntactic sugar and see if any of the alternative syntaxes are
more flexible
https://wiki.haskell.org/Case
Create a DSL.
Greetings,
Bram
On Thu, 15 Jun 2017, 16:13 Baa, <aquagnu at gmail.com> 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.
>
> Something like "(C|D) c -> ..."
>
>
> ===
> Best regards, Paul
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170615/001a7b05/attachment.html>
More information about the Haskell-Cafe
mailing list