packages feed

classy-prelude 1.2.0.1 → 1.3.0

raw patch · 3 files changed

+24/−5 lines, 3 filesdep ~basic-preludePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: basic-prelude

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.3.0++* Tracing functions leave warnings when used+ ## 1.2.0.1  * Use `HasCallStack` in `undefined`
ClassyPrelude.hs view
@@ -220,7 +220,7 @@  import System.IO (Handle, stdin, stdout, stderr, hClose) -import Debug.Trace (trace, traceShow)+import qualified Debug.Trace as Trace import Data.Semigroup (Semigroup (..), WrappedMonoid (..)) import Prelude (Show (..)) import Data.Time@@ -382,27 +382,42 @@ undefined = error "ClassyPrelude.undefined" {-# DEPRECATED undefined "It is highly recommended that you either avoid partial functions or provide meaningful error messages" #-} +-- | We define our own 'trace' (and also its variants) which provides a warning+-- when used. So that tracing is available during development, but the compiler+-- reminds you to not leave them in the code for production.+{-# WARNING trace "Leaving traces in the code" #-}+trace :: String -> a -> a+trace = Trace.trace++{-# WARNING traceShow "Leaving traces in the code" #-}+traceShow :: Show a => a -> b -> b+traceShow = Trace.traceShow+ -- | -- -- Since 0.5.9+{-# WARNING traceId "Leaving traces in the code" #-} traceId :: String -> String-traceId a = trace a a+traceId a = Trace.trace a a  -- | -- -- Since 0.5.9+{-# WARNING traceM "Leaving traces in the code" #-} traceM :: (Monad m) => String -> m ()-traceM string = trace string $ return ()+traceM string = Trace.trace string $ return ()  -- | -- -- Since 0.5.9+{-# WARNING traceShowId "Leaving traces in the code" #-} traceShowId :: (Show a) => a -> a-traceShowId a = trace (show a) a+traceShowId a = Trace.trace (show a) a  -- | -- -- Since 0.5.9+{-# WARNING traceShowM "Leaving traces in the code" #-} traceShowM :: (Show a, Monad m) => a -> m () traceShowM = traceM . show 
classy-prelude.cabal view
@@ -1,5 +1,5 @@ name:                classy-prelude-version:             1.2.0.1+version:             1.3.0 synopsis:            A typeclass-based Prelude. description:         Modern best practices without name collisions. No partial functions are exposed, but modern data structures are, without requiring import lists. Qualified modules also are not needed: instead operations are based on type-classes from the mono-traversable package.