autodocodec-nix 0.0.1.1 → 0.0.1.2
raw patch · 3 files changed
+13/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- autodocodec-nix.cabal +1/−1
- src/Autodocodec/Nix.hs +7/−2
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog +## [0.0.1.2] - 2024-08-20++* Fixed the nix type that corresponds to `null`.+* Fixed that some nix types were not being simplified enough.+ ## [0.0.1.1] - 2024-08-20 ### Changed
autodocodec-nix.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: autodocodec-nix-version: 0.0.1.1+version: 0.0.1.2 synopsis: Autodocodec interpreters for nix homepage: https://github.com/NorfairKing/autodocodec#readme bug-reports: https://github.com/NorfairKing/autodocodec/issues
src/Autodocodec/Nix.hs view
@@ -209,7 +209,12 @@ OptionTypeAttrsOf o -> OptionTypeAttrsOf $ go o OptionTypeOneOf os -> case goEnums $ nubOrd $ concatMap goOr os of [ot] -> ot- os' -> OptionTypeOneOf os'+ os' ->+ if OptionTypeNull `elem` os'+ then go $ OptionTypeNullOr $ case filter (/= OptionTypeNull) os' of+ [t] -> t+ ts' -> OptionTypeOneOf ts'+ else OptionTypeOneOf os' OptionTypeSubmodule m -> OptionTypeSubmodule $ M.map goOpt m goEnums :: [OptionType] -> [OptionType]@@ -270,7 +275,7 @@ optionTypeExpr = go where go = \case- OptionTypeNull -> ExprVar "lib.types.null"+ OptionTypeNull -> ExprAp (ExprVar "lib.types.enum") (ExprLitList [ExprNull]) OptionTypeSimple s -> ExprVar s OptionTypeEnum es -> ExprAp (ExprVar "lib.types.enum") (ExprLitList es) OptionTypeNullOr ot -> ExprAp (ExprVar "lib.types.nullOr") (go ot)