core-program 0.2.5.0 → 0.2.6.0
raw patch · 5 files changed
+28/−25 lines, 5 filesdep −prettyprinter-ansi-terminaldep ~core-datadep ~core-textdep ~prettyprinterPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: prettyprinter-ansi-terminal
Dependency ranges changed: core-data, core-text, prettyprinter
API changes (from Hackage documentation)
- Core.System.Pretty: Black :: Color
- Core.System.Pretty: Blue :: Color
- Core.System.Pretty: Cyan :: Color
- Core.System.Pretty: Green :: Color
- Core.System.Pretty: Magenta :: Color
- Core.System.Pretty: Red :: Color
- Core.System.Pretty: White :: Color
- Core.System.Pretty: Yellow :: Color
- Core.System.Pretty: bold :: AnsiStyle
- Core.System.Pretty: color :: Color -> AnsiStyle
- Core.System.Pretty: colorDull :: Color -> AnsiStyle
- Core.System.Pretty: data AnsiStyle
- Core.System.Pretty: data Color
+ Core.Program.Execute: inputEntire :: Handle -> Program τ Bytes
+ Core.Program.Execute: outputEntire :: Handle -> Bytes -> Program τ ()
- Core.System.Base: unsafePerformIO :: () => IO a -> a
+ Core.System.Base: unsafePerformIO :: IO a -> a
- Core.System.Base: withFile :: () => FilePath -> IOMode -> (Handle -> IO r) -> IO r
+ Core.System.Base: withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
- Core.System.Pretty: (<+>) :: () => Doc ann -> Doc ann -> Doc ann
+ Core.System.Pretty: (<+>) :: Doc ann -> Doc ann -> Doc ann
- Core.System.Pretty: annotate :: () => ann -> Doc ann -> Doc ann
+ Core.System.Pretty: annotate :: ann -> Doc ann -> Doc ann
- Core.System.Pretty: comma :: () => Doc ann
+ Core.System.Pretty: comma :: Doc ann
- Core.System.Pretty: dquote :: () => Doc ann
+ Core.System.Pretty: dquote :: Doc ann
- Core.System.Pretty: emptyDoc :: () => Doc ann
+ Core.System.Pretty: emptyDoc :: Doc ann
- Core.System.Pretty: enclose :: () => Doc ann -> Doc ann -> Doc ann -> Doc ann
+ Core.System.Pretty: enclose :: Doc ann -> Doc ann -> Doc ann -> Doc ann
- Core.System.Pretty: fillCat :: () => [Doc ann] -> Doc ann
+ Core.System.Pretty: fillCat :: [Doc ann] -> Doc ann
- Core.System.Pretty: fillSep :: () => [Doc ann] -> Doc ann
+ Core.System.Pretty: fillSep :: [Doc ann] -> Doc ann
- Core.System.Pretty: flatAlt :: () => Doc ann -> Doc ann -> Doc ann
+ Core.System.Pretty: flatAlt :: Doc ann -> Doc ann -> Doc ann
- Core.System.Pretty: group :: () => Doc ann -> Doc ann
+ Core.System.Pretty: group :: Doc ann -> Doc ann
- Core.System.Pretty: hang :: () => Int -> Doc ann -> Doc ann
+ Core.System.Pretty: hang :: Int -> Doc ann -> Doc ann
- Core.System.Pretty: hardline :: () => Doc ann
+ Core.System.Pretty: hardline :: Doc ann
- Core.System.Pretty: hcat :: () => [Doc ann] -> Doc ann
+ Core.System.Pretty: hcat :: [Doc ann] -> Doc ann
- Core.System.Pretty: hsep :: () => [Doc ann] -> Doc ann
+ Core.System.Pretty: hsep :: [Doc ann] -> Doc ann
- Core.System.Pretty: indent :: () => Int -> Doc ann -> Doc ann
+ Core.System.Pretty: indent :: Int -> Doc ann -> Doc ann
- Core.System.Pretty: lbrace :: () => Doc ann
+ Core.System.Pretty: lbrace :: Doc ann
- Core.System.Pretty: lbracket :: () => Doc ann
+ Core.System.Pretty: lbracket :: Doc ann
- Core.System.Pretty: line :: () => Doc ann
+ Core.System.Pretty: line :: Doc ann
- Core.System.Pretty: line' :: () => Doc ann
+ Core.System.Pretty: line' :: Doc ann
- Core.System.Pretty: lparen :: () => Doc ann
+ Core.System.Pretty: lparen :: Doc ann
- Core.System.Pretty: nest :: () => Int -> Doc ann -> Doc ann
+ Core.System.Pretty: nest :: Int -> Doc ann -> Doc ann
- Core.System.Pretty: punctuate :: () => Doc ann -> [Doc ann] -> [Doc ann]
+ Core.System.Pretty: punctuate :: Doc ann -> [Doc ann] -> [Doc ann]
- Core.System.Pretty: rbrace :: () => Doc ann
+ Core.System.Pretty: rbrace :: Doc ann
- Core.System.Pretty: rbracket :: () => Doc ann
+ Core.System.Pretty: rbracket :: Doc ann
- Core.System.Pretty: rparen :: () => Doc ann
+ Core.System.Pretty: rparen :: Doc ann
- Core.System.Pretty: sep :: () => [Doc ann] -> Doc ann
+ Core.System.Pretty: sep :: [Doc ann] -> Doc ann
- Core.System.Pretty: softline :: () => Doc ann
+ Core.System.Pretty: softline :: Doc ann
- Core.System.Pretty: softline' :: () => Doc ann
+ Core.System.Pretty: softline' :: Doc ann
- Core.System.Pretty: squote :: () => Doc ann
+ Core.System.Pretty: squote :: Doc ann
- Core.System.Pretty: unAnnotate :: () => Doc ann -> Doc xxx
+ Core.System.Pretty: unAnnotate :: Doc ann -> Doc xxx
- Core.System.Pretty: vcat :: () => [Doc ann] -> Doc ann
+ Core.System.Pretty: vcat :: [Doc ann] -> Doc ann
- Core.System.Pretty: vsep :: () => [Doc ann] -> Doc ann
+ Core.System.Pretty: vsep :: [Doc ann] -> Doc ann
Files
- core-program.cabal +5/−6
- lib/Core/Program/Arguments.hs +0/−1
- lib/Core/Program/Execute.hs +22/−11
- lib/Core/Program/Notify.hs +1/−1
- lib/Core/System/Pretty.hs +0/−6
core-program.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: a518f4719d8c63a92778aeb8d0dac45fd444d9db8f61c148b0f486cc9d993ab9+-- hash: 5ed0f9b93db8395fee43607d6360220db104b7dd764b60896ac8b495e2d79621 name: core-program-version: 0.2.5.0+version: 0.2.6.0 synopsis: Opinionated Haskell Interoperability description: A library to help build command-line programs, both tools and longer-running daemons.@@ -58,8 +58,8 @@ , base >=4.11 && <5 , bytestring , chronologique- , core-data- , core-text >=0.2.2+ , core-data >=0.2.1.9+ , core-text >=0.3.0 , directory , exceptions , filepath@@ -67,8 +67,7 @@ , hashable >=1.2 , hourglass , mtl- , prettyprinter >=1.2.1.1- , prettyprinter-ansi-terminal+ , prettyprinter >=1.6.2 , safe-exceptions , stm , template-haskell >=2.14 && <3
lib/Core/Program/Arguments.hs view
@@ -45,7 +45,6 @@ ) where -import Control.Exception.Safe (Exception (displayException)) import Core.Data.Structures import Core.Program.Metadata import Core.System.Base
lib/Core/Program/Execute.hs view
@@ -29,7 +29,7 @@ -- logging. A common annoyance when building command line tools and daemons is -- getting program output to @stdout@ and debug messages interleaved, made -- even worse when error messages written to @stderr@ land in the same--- console. To avoid this, when all output is sent through a single channel.+-- console. To avoid this, all output is sent through a single channel. -- This includes both normal output and log messages. -- -- /Exceptions/@@ -70,12 +70,10 @@ getConsoleWidth, getApplicationState, setApplicationState,- retrieve,- update, -- * Useful actions- output,- input,+ outputEntire,+ inputEntire, -- * Concurrency Thread,@@ -89,6 +87,11 @@ unProgram, unThread, invalid,++ retrieve,+ update,+ output,+ input, ) where @@ -106,11 +109,9 @@ import Control.Concurrent.STM (atomically, check) import Control.Concurrent.STM.TQueue (TQueue, isEmptyTQueue, readTQueue) import qualified Control.Exception as Base (throwIO)-import Control.Exception.Safe (Exception (displayException), SomeException) import qualified Control.Exception.Safe as Safe (catchesAsync, throw) import Control.Monad (forever, when) import Control.Monad.Catch (Handler (..))-import Control.Monad.IO.Class (liftIO) import Control.Monad.Reader.Class (MonadReader (ask)) import Core.Data.Structures import Core.Program.Arguments@@ -388,12 +389,12 @@ modifyMVar_ v (\_ -> pure user) -- |--- Alias for 'getApplicationState'.+{-# DEPRECATED retrieve "Use getApplicationState instead" #-} retrieve :: Program τ τ retrieve = getApplicationState -- |--- Alias for 'setApplicationState'.+{-# DEPRECATED update "Use setApplicationState instead" #-} update :: τ -> Program τ () update = setApplicationState @@ -415,13 +416,23 @@ -- -- (which is not /unsafe/, but will lead to unexpected results if the binary -- blob you pass in is other than UTF-8 text).+outputEntire :: Handle -> Bytes -> Program τ ()+outputEntire handle contents = liftIO (hOutput handle contents)++-- |+{-# DEPRECATED output "Use outputEntire instead" #-} output :: Handle -> Bytes -> Program τ ()-output handle contents = liftIO (hOutput handle contents)+output = outputEntire -- | -- Read the (entire) contents of the specified @Handle@.+inputEntire :: Handle -> Program τ Bytes+inputEntire handle = liftIO (hInput handle)++-- |+{-# DEPRECATED input "Use inputEntire instead" #-} input :: Handle -> Program τ Bytes-input handle = liftIO (hInput handle)+input = inputEntire -- | -- A thread for concurrent computation. Haskell uses green threads: small
lib/Core/Program/Notify.hs view
@@ -16,7 +16,7 @@ import Core.Program.Execute import Core.Program.Logging import Core.Program.Unlift-import Data.Foldable (foldr, foldrM)+import Data.Foldable (foldrM) import System.Directory (canonicalizePath) import System.FSNotify (Event (..), eventPath, watchDir, withManager) import System.FilePath (dropFileName)
lib/Core/System/Pretty.hs view
@@ -44,13 +44,7 @@ indent, nest, concatWith,- color,- colorDull,- Color (..),- AnsiStyle,- bold, ) where import Data.Text.Prettyprint.Doc-import Data.Text.Prettyprint.Doc.Render.Terminal