[darcs-devel] [patch1466] cleanup in Darcs.Patch.Merge: use case instead of from...

Ben Franksen bugs at darcs.net
Tue Mar 8 23:20:40 UTC 2016


New submission from Ben Franksen <benjamin.franksen at helmholtz-berlin.de>:

Note that these are pure, total functions. There is no justification for
using 'fromJust' here, merely to support monadic style.

(If the latter is preferred, then the proper choice would be
Data.Functor.Identity.runIdentity which is total and has guaranteed zero
runtime overhead.)

Anyway, cascading case expressions are clearer IMO, less noisy (e.g. no
"return $" on each line), and are generally more robust against changes in
the data type (you get a warning about incomplete patterns if constructors
are added (though I concede that this is unlikely here)).

1 patch for repository http://darcs.net/screened:

patch c553aac0b42564699190b34cc54a245e7e3c4e9e
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Tue Mar  8 23:49:03 CET 2016
  * cleanup in Darcs.Patch.Merge: use case instead of fromJust (do return ...)

----------
files: cleanup-in-darcs_patch_merge_-use-case-instead-of-fromjust-_do-return-____.dpatch, patch-preview.txt, unnamed
messages: 19057
nosy: bf
status: needs-screening
title: cleanup in Darcs.Patch.Merge: use case instead of from...

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1466>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 1381 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20160308/08613fcc/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanup-in-darcs_patch_merge_-use-case-instead-of-fromjust-_do-return-____.dpatch
Type: application/x-darcs-patch
Size: 26334 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20160308/08613fcc/attachment-0003.bin>
-------------- next part --------------
.





More information about the darcs-devel mailing list