packages feed

loch-th 0.1 → 0.2

raw patch · 2 files changed

+11/−8 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Debug/Trace/LocationTH.hs view
@@ -76,13 +76,14 @@ assert :: Q Exp -> Q Exp assert t = do     st <- pprint `fmap` t-    [|-        \cont -> if not $t-            then throw $ AssertionFailed $-                $__LOCATION__ ++ ": Assertion `" ++ st ++ "' failed"-            else cont+    [| if' (not $t) $ throw $ AssertionFailed $+        $__LOCATION__ ++ ": Assertion `" ++ st ++ "' failed"      |] +if' :: Bool -> a -> a -> a+if' True  x _ = x+if' False _ y = y+ -- -- | A location-emitting 'error' call. --@@ -92,7 +93,7 @@ -- *** Exception: <interactive>:1:1-8: no such thing. -- failure :: Q Exp-failure = [| \t -> error $ $__LOCATION__ ++ ": " ++ t |]+failure = [| error . ($__LOCATION__ ++) . (": " ++) |]  -- -- | A location-emitting 'undefined'.@@ -121,6 +122,8 @@ -- -- >>> $check $ Just $ head "" -- Just *** Exception: Prelude.head: empty list+-- >>> Just $ $check $ head ""+-- Just *** Exception: <interactive>:9:8-13: Prelude.head: empty list -- >>> $check $ join deepseq $ Just $ head "" -- *** Exception: <interactive>:1:1-6: Prelude.head: empty list --@@ -138,7 +141,7 @@ -- "*** Exception: <interactive>:1:1-8: /foo: openFile: does not exist (No such file or directory) -- checkIO :: Q Exp-checkIO = [| \a -> C.catch a $ \e -> return $ $failure (showEx e) |]+checkIO = [| flip C.catch (return . $failure . showEx) |]  showEx :: C.SomeException -> String showEx = show
loch-th.cabal view
@@ -1,5 +1,5 @@ Name:                loch-th-Version:             0.1+Version:             0.2 Synopsis:            Support for precise error locations in source files (Template Haskell version) Description:         This module provides a Template Haskell based mechanism to 		     tag failures with the location of the failure call. The