[GHC] #14349: Semigroup/Monoid instances for System.Exit.ExitCode

GHC ghc-devs at haskell.org
Fri Oct 13 15:19:20 UTC 2017


#14349: Semigroup/Monoid instances for System.Exit.ExitCode
-------------------------------------+-------------------------------------
        Reporter:  neil.mayhew       |                Owner:  (none)
            Type:  feature request   |               Status:  upstream
        Priority:  low               |            Milestone:
       Component:  libraries/base    |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by glguy):

 Having a Monoid instance doesn't seem like a good idea to me. The code
 above could be written more clearly using an explicitly named, locally
 defined operation: `combineExitCodes <$> mapM system commands`. Reusing
 `mconcat` isn't a win here.

 Having such a forced Monoid instance simply means that users will have to
 consult the documentation to find the instance declaration to determine
 what behavior it has. There isn't a natural meaning for `instance Monoid
 ExitCode`

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14349#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list