Hello community, here is the log from the commit of package ghc-rio for openSUSE:Leap:15.2 checked in at 2020-03-10 17:14:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/ghc-rio (Old) and /work/SRC/openSUSE:Leap:15.2/.ghc-rio.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-rio" Tue Mar 10 17:14:43 2020 rev:4 rq:783372 version:0.1.14.0 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/ghc-rio/ghc-rio.changes 2020-02-19 18:40:58.226172590 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.ghc-rio.new.26092/ghc-rio.changes 2020-03-10 17:14:47.677442177 +0100 @@ -1,0 +2,9 @@ +Thu Feb 27 14:16:53 UTC 2020 - [email protected] + +- Update rio to version 0.1.14.0. + ## 0.1.14.0 + + * Addition of `mkSimpleApp` + * Addition of `lookupEnvFromContext` + +------------------------------------------------------------------- Old: ---- rio-0.1.13.0.tar.gz New: ---- rio-0.1.14.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-rio.spec ++++++ --- /var/tmp/diff_new_pack.sjxyDb/_old 2020-03-10 17:14:48.393442400 +0100 +++ /var/tmp/diff_new_pack.sjxyDb/_new 2020-03-10 17:14:48.393442400 +0100 @@ -19,7 +19,7 @@ %global pkg_name rio %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.1.13.0 +Version: 0.1.14.0 Release: 0 Summary: A standard library for Haskell License: MIT ++++++ rio-0.1.13.0.tar.gz -> rio-0.1.14.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.13.0/ChangeLog.md new/rio-0.1.14.0/ChangeLog.md --- old/rio-0.1.13.0/ChangeLog.md 2020-01-17 06:27:44.000000000 +0100 +++ new/rio-0.1.14.0/ChangeLog.md 2020-02-11 07:25:50.000000000 +0100 @@ -1,5 +1,10 @@ # Changelog for rio +## 0.1.14.0 + +* Addition of `mkSimpleApp` +* Addition of `lookupEnvFromContext` + ## 0.1.13.0 * Add `withLazyFileUtf8` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.13.0/rio.cabal new/rio-0.1.14.0/rio.cabal --- old/rio-0.1.13.0/rio.cabal 2020-01-17 06:22:49.000000000 +0100 +++ new/rio-0.1.14.0/rio.cabal 2020-02-11 07:47:23.000000000 +0100 @@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.2. +-- This file has been generated from package.yaml by hpack version 0.32.0. -- -- see: https://github.com/sol/hpack -- --- hash: 8e4af889359b601656dfdc5de6e99c1ae5312558aa4768684771e5a0fb8e6a8e +-- hash: 3304dcc13a958b77f994720f0df6f7b7714d1ed441b38b6ab56b91b30164bcd2 name: rio -version: 0.1.13.0 +version: 0.1.14.0 synopsis: A standard library for Haskell description: See README and Haddocks at <https://www.stackage.org/package/rio> category: Control diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.13.0/src/RIO/Prelude/Simple.hs new/rio-0.1.14.0/src/RIO/Prelude/Simple.hs --- old/rio-0.1.13.0/src/RIO/Prelude/Simple.hs 2018-06-19 17:29:26.000000000 +0200 +++ new/rio-0.1.14.0/src/RIO/Prelude/Simple.hs 2020-02-11 07:25:50.000000000 +0100 @@ -1,5 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-} --- | Provide a @SimpleApp@ datatype, for providing a basic @App@-like +-- | Provide a @`SimpleApp`@ datatype, for providing a basic @App@-like -- environment with common functionality built in. This is intended to -- make it easier to, e.g., use rio's logging and process code from -- within short scripts. @@ -7,6 +7,7 @@ -- @since 0.1.3.0 module RIO.Prelude.Simple ( SimpleApp + , mkSimpleApp , runSimpleApp ) where @@ -31,6 +32,17 @@ instance HasProcessContext SimpleApp where processContextL = lens saProcessContext (\x y -> x { saProcessContext = y }) + +-- | Constructor for `SimpleApp`. In case when `ProcessContext` is not supplied +-- `mkDefaultProcessContext` will be used to create it. +-- +-- @since 0.1.14.0 +mkSimpleApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> m SimpleApp +mkSimpleApp logFunc mProcessContext = do + processContext <- maybe mkDefaultProcessContext pure mProcessContext + pure $ SimpleApp {saLogFunc = logFunc, saProcessContext = processContext} + + -- | Run with a default configured @SimpleApp@, consisting of: -- -- * Logging to stderr @@ -45,10 +57,6 @@ runSimpleApp m = liftIO $ do verbose <- isJust <$> lookupEnv "RIO_VERBOSE" lo <- logOptionsHandle stderr verbose - pc <- mkDefaultProcessContext - withLogFunc lo $ \lf -> - let simpleApp = SimpleApp - { saLogFunc = lf - , saProcessContext = pc - } - in runRIO simpleApp m + withLogFunc lo $ \lf -> do + simpleApp <- mkSimpleApp lf Nothing + runRIO simpleApp m diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.13.0/src/RIO/Process.hs new/rio-0.1.14.0/src/RIO/Process.hs --- old/rio-0.1.13.0/src/RIO/Process.hs 2020-01-17 06:22:33.000000000 +0100 +++ new/rio-0.1.14.0/src/RIO/Process.hs 2020-02-11 07:25:50.000000000 +0100 @@ -44,6 +44,7 @@ , mkDefaultProcessContext , modifyEnvVars , withModifyEnvVars + , lookupEnvFromContext , withWorkingDir -- ** Lenses , workingDirL @@ -296,6 +297,7 @@ -- is incomplete.) defaultPATHEXT = ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" + -- | Reset the executable cache. -- -- @since 0.0.3.0 @@ -331,7 +333,7 @@ pc' <- mkProcessContext (f $ pcTextMap pc) return pc' { pcWorkingDir = pcWorkingDir pc } --- | Use 'modifyEnvVarMap' to create a new 'ProcessContext', and then +-- | Use 'modifyEnvVars' to create a new 'ProcessContext', and then -- use it in the provided action. -- -- @since 0.0.3.0 @@ -345,6 +347,13 @@ pc' <- modifyEnvVars pc f local (set processContextL pc') inner +-- | Look into the `ProcessContext` and return the specified environmet variable if one is +-- available. +-- +-- @since 0.1.14.0 +lookupEnvFromContext :: (MonadReader env m, HasProcessContext env) => Text -> m (Maybe Text) +lookupEnvFromContext envName = Map.lookup envName <$> view envVarsL + -- | Set the working directory to be used by child processes. -- -- @since 0.0.3.0
