hercules-ci-cnix-expr 0.3.0.0 → 0.3.1.0
raw patch · 3 files changed
+20/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Hercules.CNix.Expr.Schema: instance (Hercules.CNix.Expr.Typed.CheckType (Hercules.CNix.Expr.Schema.NixTypeForSchema t), Hercules.CNix.Expr.Typed.HasRawValueType (Hercules.CNix.Expr.Schema.NixTypeForSchema t)) => Hercules.CNix.Expr.ToValue (Hercules.CNix.Expr.Schema.PSObject t)
+ Hercules.CNix.Expr.Schema: instance Hercules.CNix.Expr.ToRawValue (Hercules.CNix.Expr.Schema.PSObject a)
Files
- CHANGELOG.md +6/−0
- hercules-ci-cnix-expr.cabal +1/−1
- src/Hercules/CNix/Expr/Schema.hs +13/−1
CHANGELOG.md view
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## 0.3.1.0 - 2022-03-18++### Added++ - `instance ToValue (PSObject t)`+ ## 0.3.0.0 - 2022-03-15 ### Added
hercules-ci-cnix-expr.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: hercules-ci-cnix-expr-version: 0.3.0.0+version: 0.3.1.0 synopsis: Bindings for the Nix evaluator category: Nix, CI, Testing, DevOps homepage: https://docs.hercules-ci.com
src/Hercules/CNix/Expr/Schema.hs view
@@ -84,7 +84,7 @@ import qualified Data.Map as M import qualified Data.Text as T import qualified GHC.TypeLits as TL-import Hercules.CNix.Expr (CheckType, EvalState, HasRawValueType, NixAttrs, NixFunction, NixPath, NixString, RawValue, Value (rtValue), apply, checkType, getAttr, getRawValueType, getStringIgnoreContext, hasContext, rawValueType, toRawValue, valueFromExpressionString)+import Hercules.CNix.Expr (CheckType, EvalState, HasRawValueType, NixAttrs, NixFunction, NixPath, NixString, RawValue, ToRawValue (..), ToValue (..), Value (rtValue), apply, checkType, getAttr, getRawValueType, getStringIgnoreContext, hasContext, rawValueType, toRawValue, valueFromExpressionString) import qualified Hercules.CNix.Expr as Expr import Hercules.CNix.Expr.Raw (RawValueType, canonicalRawType) import Protolude hiding (TypeError, check, evalState)@@ -185,6 +185,18 @@ -- Use 'check' and/or '|.' to evaluate it (whnf) and narrow down its runtime type to a specific 'Value'. value :: RawValue }++instance ToRawValue (PSObject a) where+ toRawValue _ = pure . value++instance+ ( CheckType (NixTypeForSchema t),+ HasRawValueType (NixTypeForSchema t)+ ) =>+ ToValue (PSObject t)+ where+ type NixTypeFor (PSObject t) = NixTypeForSchema t+ toValue es v = runReaderT (check v) es (.$) :: (MonadIO m) => PSObject (a ->. b) -> PSObject a -> m (PSObject b) f .$ a = do