packages feed

control-monad-exception 0.4.2 → 0.4.3

raw patch · 2 files changed

+18/−16 lines, 2 files

Files

Control/Monad/Exception.hs view
@@ -124,9 +124,8 @@   [| withLoc loc_msg |]  where    showLoc Loc{loc_module, loc_filename, loc_start} = render $-                     {- text loc_package <> dot <> -}-                     text loc_module <> dot <> text loc_filename <> colon <+> text (show loc_start)-   dot = char '.'+                     {- text loc_package <> char '.' <> -}+                     text loc_module <> parens (text loc_filename) <> colon <+> text (show loc_start)  -- | Generating stack traces for exceptions class WithSrcLoc a where
control-monad-exception.cabal view
@@ -1,5 +1,5 @@ name: control-monad-exception-version: 0.4.2+version: 0.4.3 Cabal-Version:  >= 1.2.3 build-type: Simple license: PublicDomain@@ -36,22 +36,25 @@   > runEM(eval `catch` \ (e::SomeException) -> return (-1))  :: Expr -> Double   .   New in version 0.4:-    * (optionally) Unchecked exceptions (with 'UncaughtException')-    * Exception stack traces (with 'WithSrcLoc'). /Example/   .-  > f () = $withLocTH $ throw MyException-  > g a  = $withLocTH $ f a+    * Support for unchecked exceptions (with 'UncaughtException')+  .+    * Support for exception stack traces (with 'WithSrcLoc'). /Example/+  .+  >       f () = $withLocTH $ throw MyException+  >       g a  = $withLocTH $ f a   >-  > main = runEMT $ $withLocTH $ do-  > g () `catchWithSrcLoc` \loc MyException ->-  >       lift $ putStrLn (showExceptionWithTrace loc MyException)+  >       main = runEMT $ $withLocTH $ do+  >       g () `catchWithSrcLoc` \loc MyException ->+  >              lift $ putStrLn (showExceptionWithTrace loc MyException)   .-  Running @main@ produces the output:+  > -- Running @main@ produces the output:   .-  > *Main> main-  > MyException-  >  in Main.docatch.hs: (12,6)-  >     Main.docatch.hs: (11,7)+  >       *Main> main+  >       MyException+  >        in Main(example.hs): (12,6)+  >           Main(example.hs): (11,7)+  .  synopsis: Explicitly typed, checked exceptions with stack traces category: Control, Monads