[GHC] #14349: Semigroup/Monoid instances for System.Exit.ExitCode
GHC
ghc-devs at haskell.org
Fri Oct 13 13:51:09 UTC 2017
#14349: Semigroup/Monoid instances for System.Exit.ExitCode
-------------------------------------+-------------------------------------
Reporter: neil.mayhew | Owner: (none)
Type: feature | Status: new
request |
Priority: low | Milestone:
Component: | Version: 8.2.1
libraries/base |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
Please add instances for ExitCode along the following lines:
{{{#!hs
instance Monoid ExitCode where
mempty = ExitSuccess
mappend ExitSuccess b = b
mappend a _ = a
}}}
This allows the summary result of multiple child processes to be computed
naturally. For example:
{{{#!hs
mconcat <$> mapM system commands
}}}
The result is `ExitSuccess` if they all succeeded, and the leftmost
failure otherwise
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14349>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list