Quick code style question: Wild card binders

Joachim Breitner mail at joachim-breitner.de
Tue Jan 14 09:59:36 UTC 2014


Hi,

Am Dienstag, den 14.01.2014, 08:57 +0000 schrieb Joachim Breitner:
> both work, so it is a matter of style, and I’m not sure which one is
> better style: If I generate a Case where the case binder is not used,
> should I 
>  * use the wildcard binder (mkWildCase), to be explicit about the fact 
>    fact that the wildcard binder is unused, or should I
>  * generate a new Unique and a new Id nevertheless, because wildCard is 
>    bad?

here I is what I learned from SPJ: If I have access to a monad, better
use a unique. Even if the case binder is not used _now_ when I generate
the code, later simplifier phases might attempt to make use of it.

If I had not access to a monad, then using the wild binder is ok if I
have control over the body and its free variables.

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0x4743206C
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140114/a117d62b/attachment.sig>


More information about the ghc-devs mailing list