dhall-bash 1.0.31 → 1.0.32
raw patch · 2 files changed
+21/−22 lines, 2 filesdep ~basedep ~dhallPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, dhall
API changes (from Hackage documentation)
Files
- dhall-bash.cabal +9/−9
- src/Dhall/Bash.hs +12/−13
dhall-bash.cabal view
@@ -1,8 +1,8 @@ Name: dhall-bash-Version: 1.0.31+Version: 1.0.32 Cabal-Version: >=1.10 Build-Type: Simple-Tested-With: GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1+Tested-With: GHC == 8.4.3, GHC == 8.6.1 License: BSD3 License-File: LICENSE Copyright: 2017 Gabriel Gonzalez@@ -28,13 +28,13 @@ Library Hs-Source-Dirs: src Build-Depends:- base >= 4.8.0.0 && < 5 ,- bytestring < 0.11,- containers < 0.7 ,- dhall >= 1.33.0 && < 1.34,- neat-interpolation < 0.6 ,- shell-escape < 0.3 ,- text >= 0.2 && < 1.3+ base >= 4.11.0.0 && < 5 ,+ bytestring < 0.11,+ containers < 0.7 ,+ dhall >= 1.34.0 && < 1.35,+ neat-interpolation < 0.6 ,+ shell-escape < 0.3 ,+ text >= 0.2 && < 1.3 Exposed-Modules: Dhall.Bash GHC-Options: -Wall Default-Language: Haskell2010
src/Dhall/Bash.hs view
@@ -101,12 +101,11 @@ ) where import Control.Exception (Exception)-import Data.Bifunctor (first)+import Data.Bifunctor (first) import Data.ByteString-import Data.Monoid ((<>))-import Data.Typeable (Typeable)-import Data.Void (Void, absurd)-import Dhall.Core (Expr(..), Chunks(..))+import Data.Typeable (Typeable)+import Data.Void (Void, absurd)+import Dhall.Core (Chunks (..), Expr (..)) import qualified Data.Foldable import qualified Data.Text@@ -227,9 +226,9 @@ adapt (UnsupportedExpression e) = UnsupportedSubexpression e - go (BoolLit a) = do+ go (BoolLit a) = go (TextLit (if a then "true" else "false"))- go (NaturalLit a) = do+ go (NaturalLit a) = go (IntegerLit (fromIntegral a)) go (IntegerLit a) = do e <- first adapt (dhallToExpression (IntegerLit a))@@ -256,7 +255,7 @@ let bytes = Data.Text.Encoding.encodeUtf8 k let k' = Text.ShellEscape.bytes (Text.ShellEscape.bash bytes) return ("[" <> k' <> "]=" <> v')- kvs' <- first adapt (traverse process (Dhall.Map.toList a))+ kvs' <- first adapt (traverse process (Dhall.Map.toList $ Dhall.Core.recordFieldValue <$> a)) let bytes = "declare -r -A " <> var@@ -268,9 +267,9 @@ e <- first adapt (dhallToExpression (Field (Union m) k)) let bytes = "declare -r " <> var <> "=" <> e return bytes- go (Embed x) = do+ go (Embed x) = absurd x- go (Note _ e) = do+ go (Note _ e) = go e -- Use an exhaustive pattern match here so that we don't forget to handle@@ -352,11 +351,11 @@ -- ^ Bash expression or compile failure dhallToExpression expr0 = go (Dhall.Core.normalize expr0) where- go (BoolLit a) = do+ go (BoolLit a) = go (TextLit (if a then "true" else "false"))- go (NaturalLit a) = do+ go (NaturalLit a) = go (IntegerLit (fromIntegral a))- go (IntegerLit a) = do+ go (IntegerLit a) = go (TextLit (Chunks [] (Data.Text.pack (show a)))) go (TextLit (Chunks [] a)) = do let bytes = Data.Text.Encoding.encodeUtf8 a