core-program 0.2.3.0 → 0.2.4.1
raw patch · 4 files changed
+20/−4 lines, 4 filesdep ~prettyprinterPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: prettyprinter
API changes (from Hackage documentation)
+ Core.Program.Execute: getConsoleWidth :: Program τ Int
+ Core.System.Pretty: enclose :: () => Doc ann -> Doc ann -> Doc ann -> Doc ann
+ Core.System.Pretty: squote :: () => Doc ann
Files
- core-program.cabal +3/−3
- lib/Core/Program/Context.hs +0/−1
- lib/Core/Program/Execute.hs +15/−0
- lib/Core/System/Pretty.hs +2/−0
core-program.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 4e77f8a52fdda1e7b768f75d3602960d1f59897d2a626c22af12a5f58dc5b38c+-- hash: 7e0eff3f9f82d279f562a769a41334fdf5600e0bc7c99d4fd9a09b3ad851a872 name: core-program-version: 0.2.3.0+version: 0.2.4.1 synopsis: Opinionated Haskell Interoperability description: A library to help build command-line programs, both tools and longer-running daemons.@@ -67,7 +67,7 @@ , hashable >=1.2 && <1.4 , hourglass , mtl- , prettyprinter >=1.2.1.1 && <1.6+ , prettyprinter >=1.2.1.1 && <1.7 , prettyprinter-ansi-terminal , safe-exceptions , stm
lib/Core/Program/Context.hs view
@@ -22,7 +22,6 @@ , unProgram , getContext , subProgram- , getConsoleWidth ) where import Prelude hiding (log)
lib/Core/Program/Execute.hs view
@@ -65,6 +65,7 @@ , setProgramName , getVerbosityLevel , setVerbosityLevel+ , getConsoleWidth , getApplicationState , setApplicationState , retrieve@@ -335,6 +336,20 @@ liftIO $ do let v = programNameFrom context readMVar v++{-|+Retreive the current terminal's width, in characters.++If you are outputting an object with a 'Core.Text.Untilities.Render'+instance then you may not need this; you can instead use 'wrteR' which is+aware of the width of your terminal and will reflow (in as much as the+underlying type's @Render@ instance lets it).+-}+getConsoleWidth :: Program τ Int+getConsoleWidth = do+ context <- ask+ let width = terminalWidthFrom context+ return width {-| Get the user supplied application state as originally supplied to
lib/Core/System/Pretty.hs view
@@ -12,8 +12,10 @@ Doc , Pretty(pretty) , dquote+ , squote , comma , punctuate+ , enclose , lbracket , rbracket , (<+>)