rio-prettyprint 0.1.8.0 → 0.1.9.0
raw patch · 4 files changed
+66/−55 lines, 4 files
Files
- ChangeLog.md +5/−0
- rio-prettyprint.cabal +53/−53
- src/RIO/PrettyPrint/PrettyException.hs +7/−1
- stack.yaml +1/−1
ChangeLog.md view
@@ -1,5 +1,10 @@ # Changelog for rio-prettyprint +## 0.1.9.0 + +* Add `prettyImpureThrow`, to generate a value which, when forced, will throw an + exception as a `PrettyException`. + ## 0.1.8.0 * Add `Arch` and `OS` instances of `Pretty`.
rio-prettyprint.cabal view
@@ -1,54 +1,54 @@ cabal-version: 1.12 - --- This file has been generated from package.yaml by hpack version 0.36.0. --- --- see: https://github.com/sol/hpack - -name: rio-prettyprint -version: 0.1.8.0 -synopsis: Pretty-printing for RIO -description: Combine RIO's log capabilities with pretty printing -category: Development -homepage: https://github.com/commercialhaskell/rio-prettyprint#readme -bug-reports: https://github.com/commercialhaskell/rio-prettyprint/issues -author: Michael Snoyman -maintainer: michael@snoyman.com -copyright: 2018-2023 FP Complete -license: BSD3 -license-file: LICENSE -build-type: Simple -extra-source-files: - ChangeLog.md - README.md - stack.yaml - -source-repository head - type: git - location: https://github.com/commercialhaskell/rio-prettyprint - -library - exposed-modules: - RIO.PrettyPrint - RIO.PrettyPrint.DefaultStyles - RIO.PrettyPrint.PrettyException - RIO.PrettyPrint.Simple - RIO.PrettyPrint.StylesUpdate - RIO.PrettyPrint.Types - Text.PrettyPrint.Leijen.Extended - other-modules: - Paths_rio_prettyprint - hs-source-dirs: - src/ - build-depends: - Cabal - , aeson - , annotated-wl-pprint - , ansi-terminal >=0.9 - , array - , base >=4.10 && <5 - , colour - , mtl - , path >0.9.1 - , rio - , text - default-language: Haskell2010 ++-- This file has been generated from package.yaml by hpack version 0.39.1.+--+-- see: https://github.com/sol/hpack++name: rio-prettyprint+version: 0.1.9.0+synopsis: Pretty-printing for RIO+description: Combine RIO's log capabilities with pretty printing+category: Development+homepage: https://github.com/commercialhaskell/rio-prettyprint#readme+bug-reports: https://github.com/commercialhaskell/rio-prettyprint/issues+author: Michael Snoyman+maintainer: michael@snoyman.com+copyright: 2018-2023 FP Complete+license: BSD3+license-file: LICENSE+build-type: Simple+extra-source-files:+ ChangeLog.md+ README.md+ stack.yaml++source-repository head+ type: git+ location: https://github.com/commercialhaskell/rio-prettyprint++library+ exposed-modules:+ RIO.PrettyPrint+ RIO.PrettyPrint.DefaultStyles+ RIO.PrettyPrint.PrettyException+ RIO.PrettyPrint.Simple+ RIO.PrettyPrint.StylesUpdate+ RIO.PrettyPrint.Types+ Text.PrettyPrint.Leijen.Extended+ other-modules:+ Paths_rio_prettyprint+ hs-source-dirs:+ src/+ build-depends:+ Cabal+ , aeson+ , annotated-wl-pprint+ , ansi-terminal >=0.9+ , array+ , base >=4.10 && <5+ , colour+ , mtl+ , path >0.9.1+ , rio+ , text+ default-language: Haskell2010
src/RIO/PrettyPrint/PrettyException.hs view
@@ -59,11 +59,12 @@ , ppException , prettyThrowIO , prettyThrowM + , prettyImpureThrow ) where import RIO ( Exception (..), Maybe (..), MonadIO, MonadThrow, Show, SomeException - , Typeable, (.), throwIO, throwM + , Typeable, (.), impureThrow, throwIO, throwM ) import Text.PrettyPrint.Leijen.Extended ( Pretty (..), StyleDoc, string ) @@ -96,3 +97,8 @@ -- the monad @m@. prettyThrowM :: (Exception e, MonadThrow m, Pretty e) => e -> m a prettyThrowM = throwM . PrettyException + +-- | Generate a pure value which, when forced, will synchronously throw the +-- given exception as a 'PrettyException'. +prettyImpureThrow :: (Exception e, Pretty e) => e -> a +prettyImpureThrow = impureThrow . PrettyException
stack.yaml view
@@ -1,1 +1,1 @@-resolver: stack-ghc-9.6.3.yaml +snapshot: stack-ghc-9.10.3.yaml