-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On Tue, Dec 16, 2008 at 3:14 PM, Neil Mitchell wrote:
> Hi
>
> Before starting, I should say that I agree that some of the hints
> aren't universally applicable.
>
>> Whether "Eta reduce" makes sense or not varies on a case-by-case basis,
>> IMO. The question is mostly, "which is easiest to read and understand?".
>
> I particularly agree about this one, I'm still trying to see if there
> is a general rule behind it or not...
My intuition has always been, if it reduces parentheses, it's probably
good. That is, 'foo a = baz (bar a)' would be reduced down to 'foo =
baz . bar', which has fewer parentheses, and so is clearer. But
something like 'f x y = z (x y)' turns 'f = (z .)' with the same
number of parentheses, but is worse. (And some expressions can lead to
horrifying pointless versions, needless to say.)
>> "Use a list comprehension" I'm not convinced isn't an obfuscation.
>> Again, the tool has added redundant parentheses.
>
> Colin does it, I think it looks cool :-) I find it a cool pattern, but
> others can sensibly disagree.
Just to chip in: I found most of those list comprehensions less clear as well.
> Thanks for the comments,
>
> Neil
One thing I wonder. Is the general approach of using '$' to get rid of
parentheses subsumed under the eta-reduction advice?
And does Dr. Haskell handle imports? There are a number of things
which could be done there ('You always prefix a function from this
module with its full name - perhaps you should import it qualified as
well'; 'You only use two functions from this import. Explicitly
importing them would make your module more future-proof and the module
clearer'; 'you hide more functions/things than you allow in, so an
explicit import would save you space' etc.)
- ---------
Also on a more general darcs note, how are we going to treat Dr.
Haskell's report? Have a few patches treating just its issues?
- --
gwern
- --
gwern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEAREKAAYFAklILC0ACgkQvpDo5Pfl1oL3nACfaPUbGjPf0nDyHszUDix7nUQ8
S+QAoIwgi4Aepe9Vla3ZFvqbTbqJbzHD
=2eCN
-----END PGP SIGNATURE-----
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users