#8769 closed bug (fixed)

Minor refactoring of Maybe.lhs

Reported by: Iceland_jack Owned by: nomeata
Priority: lowest Milestone:
Component: libraries (other) Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

Minor refactoring in Maybe.lhs.

Attachments (2)

0001-Minor-code-refactoring-in-Maybes.lhs.patch (1.7 KB) - added by Iceland_jack 15 months ago.
0001-Cleaned-up-Maybes.lhs.patch (18.5 KB) - added by Iceland_jack 15 months ago.

Download all attachments as: .zip

Change History (10)

Changed 15 months ago by Iceland_jack

comment:1 Changed 15 months ago by Iceland_jack

  • Status changed from new to patch

comment:2 Changed 15 months ago by nomeata

Is there a reason why you did not remove mapCatMaybes completely, and replaced it by Data.Maybe.mapMaybe?

comment:3 Changed 15 months ago by Iceland_jack

No reason really, wouldn't it be a matter of replacing every occurrence of mapCatMaybes with mapMaybe since Maybes already exports Data.Maybe? Should I add a patch for that?

comment:4 Changed 15 months ago by nomeata

Yes; while you are at it just do a thorough cleanup. Just make sure you don’t use any recent additions to base (if there are any); Anything in http://hackage.haskell.org/package/base-4.3.0.0 is ok I suppose.

Changed 15 months ago by Iceland_jack

comment:5 Changed 15 months ago by Iceland_jack

I removed mapCatMaybes, allMaybes and maybeToBool completely from Maybes, I decided to keep firstJust since the name is clearer than msum (should orElse be moved to Data.Maybe? it seems to be the sole reason for importing Maybes much of the time).

Did you have any other modules in mind that needed cleanup?

comment:6 Changed 15 months ago by Iceland_jack

Couldn't MaybeT simply be replaced with Either?

comment:7 Changed 15 months ago by nomeata

  • Owner set to nomeata

I don’t think we should be moving stuff to Data.Maybe just yet. Also, the non-monadic versions are easier to read, just as you say.

I think the patch is good to go. I’ll validate and push.

comment:8 Changed 15 months ago by nomeata

  • Resolution set to fixed
  • Status changed from patch to closed
Note: See TracTickets for help on using tickets.