[GHC] #12886: Proposal for throwLeft and throwLeftIO in Control.Exception

#12886: Proposal for throwLeft and throwLeftIO in Control.Exception -------------------------------------+------------------------------------- Reporter: yfeldblum | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: | Version: 8.0.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: -------------------------------------+------------------------------------- There already exist some functions to translate between `Maybe` and `Exception`, and between `Either` and `Exception` in the module `Control.Exception`. Given an API like: {{{#!hs data MyException --... instance Exception MyException --... myUsefulFunction :: a -> b -> c -> Either MyException d myUsefulAction :: a -> b -> c -> IO (Either MyException d) }}} It sometimes the case that calling code that cannot sensibly handle `Left` results directly. This proposal is to add standard library functions that let calling code easily to turn `Left` results into thrown runtime exceptions, which might be caught and handled further up the call stack. {{{#!hs throwLeft :: Exception e => Either e a -> a throwLeftIO :: Exception e => Either e a -> IO a }}} Note that examples of functions named `throwLeft` may be found in the wild: https://www.stackage.org/lts-7.10/hoogle?q=throwLeft. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12886 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12886: Proposal for throwLeft and throwLeftIO in Control.Exception -------------------------------------+------------------------------------- Reporter: yfeldblum | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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: | -------------------------------------+------------------------------------- Changes (by yfeldblum): * Attachment "0001-Add-throwLeft-and-throwLeftIO-to- Control.Exception.patch" added. Implementation -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12886 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12886: Proposal for throwLeft and throwLeftIO in Control.Exception -------------------------------------+------------------------------------- Reporter: yfeldblum | Owner: ekmett Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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: | -------------------------------------+------------------------------------- Changes (by simonmar): * owner: => ekmett Comment: This looks good to me. Assigning to @ekmett as per the core libraries process. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12886#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12886: Proposal for throwLeft and throwLeftIO in Control.Exception -------------------------------------+------------------------------------- Reporter: yfeldblum | Owner: ekmett Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 rwbarton): I thought the core libraries process was to make a proposal on `libraries@`? Was there one already? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12886#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12886: Proposal for throwLeft and throwLeftIO in Control.Exception -------------------------------------+------------------------------------- Reporter: yfeldblum | Owner: ekmett Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 simonmar): It used to be, now the process is to create a ticket on Trac, see https://wiki.haskell.org/Library_submissions#Guide_to_proposers -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12886#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC