[GHC] #8769: Minor refactoring of Maybe.lhs

#8769: Minor refactoring of Maybe.lhs -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- Minor refactoring in Maybe.lhs. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: Type: bug | Status: patch Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Changes (by Iceland_jack): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: Type: bug | Status: patch Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Comment (by nomeata): Is there a reason why you did not remove `mapCatMaybes` completely, and replaced it by `Data.Maybe.mapMaybe`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: Type: bug | Status: patch Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Comment (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? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: Type: bug | Status: patch Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Comment (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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: Type: bug | Status: patch Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Comment (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? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: Type: bug | Status: patch Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Comment (by Iceland_jack): Couldn't `MaybeT` simply be replaced with `Either`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: nomeata Type: bug | Status: patch Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Changes (by nomeata): * owner: => nomeata Comment: 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8769: Minor refactoring of Maybe.lhs --------------------------------------+------------------------------------ Reporter: Iceland_jack | Owner: nomeata Type: bug | Status: closed Priority: lowest | Milestone: Component: libraries (other) | Version: 7.7 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Changes (by nomeata): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8769#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC