envy 2.1.2.0 → 2.1.3.0
raw patch · 3 files changed
+8/−8 lines, 3 filesdep ~bytestringdep ~textPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: bytestring, text
API changes (from Hackage documentation)
- System.Envy: instance System.Envy.Var Data.ByteString.Internal.ByteString
+ System.Envy: instance System.Envy.Var Data.ByteString.Internal.Type.ByteString
Files
- README.md +2/−2
- envy.cabal +3/−3
- src/System/Envy.hs +3/−3
README.md view
@@ -193,9 +193,9 @@ defConfig = PGConfig "localhost" 5432 main :: IO ()-main =+main = do _ <- setEnv "PG_HOST" "customURL" True- print =<< decodeWithDefaults defConfig :: IO (Either String PGConfig)+ print =<< decodeWithDefaults defConfig -- > PGConfig { pgHost = "customURL", pgPort = 5432 } ```
envy.cabal view
@@ -1,5 +1,5 @@ name: envy-version: 2.1.2.0+version: 2.1.3.0 synopsis: An environmentally friendly way to deal with environment variables license: BSD3 license-file: LICENSE@@ -21,10 +21,10 @@ ghc-options: -Wall hs-source-dirs: src build-depends: base >= 4.11 && < 5- , bytestring == 0.10.* || == 0.11.*+ , bytestring >= 0.10 && < 0.13 , containers >= 0.5 && < 0.7 , mtl == 2.2.* || == 2.3.*- , text == 1.2.* || == 2.0.*+ , text == 1.2.* || >= 2.0 && <2.2 , time >= 1.5 && < 2.0 , transformers >= 0.4 && < 0.7 default-language: Haskell2010
src/System/Envy.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeOperators #-}@@ -89,6 +88,7 @@ import Data.Monoid import Data.Char import Data.Time+import Data.Kind import GHC.Generics import Data.Typeable import System.Environment.Blank@@ -267,7 +267,7 @@ snake :: String -> String snake = map toUpper . snakeCase -data SelectorProxy (s :: Meta) (f :: * -> *) a = SelectorProxy+data SelectorProxy (s :: Meta) (f :: Type -> Type) a = SelectorProxy ------------------------------------------------------------------------------ -- | Type class for objects which can be converted to a set of@@ -350,7 +350,7 @@ ------------------------------------------------------------------------------ -- | Environment retrieval with default values provided decodeWithDefaults :: FromEnv a => a -> IO a-decodeWithDefaults def = (\(Right x) -> x) <$> evalParser (fromEnv (Just def))+decodeWithDefaults def = either error pure =<< evalParser (fromEnv (Just def)) ------------------------------------------------------------------------------ -- | Catch an IO exception and return it in an Either.