opt-env-conf upgrades

This commit is contained in:
Tom Sydney Kerckhove 2024-06-13 11:31:59 +02:00
parent ef4a7cc685
commit 3785aaf884
7 changed files with 13 additions and 11 deletions

View File

@ -48,14 +48,14 @@ data JSONSchema
| ArraySchema !JSONSchema
| MapSchema !JSONSchema
| -- | This needs to be a list because keys should stay in their original ordering.
ObjectSchema ObjectSchema
ObjectSchema !ObjectSchema
| ValueSchema !JSON.Value
| AnyOfSchema !(NonEmpty JSONSchema)
| OneOfSchema !(NonEmpty JSONSchema)
| CommentSchema !Text !JSONSchema
| RefSchema !Text
| WithDefSchema !(Map Text JSONSchema) !JSONSchema
deriving (Show, Eq, Generic)
deriving (Show, Eq, Ord, Generic)
instance Validity JSONSchema where
validate js =
@ -167,7 +167,7 @@ data ObjectSchema
| ObjectAnyOfSchema !(NonEmpty ObjectSchema)
| ObjectOneOfSchema !(NonEmpty ObjectSchema)
| ObjectAllOfSchema !(NonEmpty ObjectSchema)
deriving (Show, Eq, Generic)
deriving (Show, Eq, Ord, Generic)
instance Validity ObjectSchema
@ -304,7 +304,7 @@ validateAccordingTo val schema = (`evalState` M.empty) $ go val schema
data KeyRequirement
= Required
| Optional !(Maybe JSON.Value) -- Default value
deriving (Show, Eq, Generic)
deriving (Show, Eq, Ord, Generic)
instance Validity KeyRequirement

View File

@ -44,7 +44,6 @@ library
, safe-coloured-text >=0.2.0.0
, scientific
, text
, unordered-containers
, vector
, yaml
default-language: Haskell2010

View File

@ -1,6 +1,6 @@
{ mkDerivation, autodocodec, autodocodec-schema, base, bytestring
, containers, lib, path, path-io, safe-coloured-text, scientific
, text, unordered-containers, vector, yaml
, text, vector, yaml
}:
mkDerivation {
pname = "autodocodec-yaml";
@ -8,8 +8,7 @@ mkDerivation {
src = ./.;
libraryHaskellDepends = [
autodocodec autodocodec-schema base bytestring containers path
path-io safe-coloured-text scientific text unordered-containers
vector yaml
path-io safe-coloured-text scientific text vector yaml
];
homepage = "https://github.com/NorfairKing/autodocodec#readme";
description = "Autodocodec interpreters for yaml";

View File

@ -26,6 +26,5 @@ library:
- safe-coloured-text >=0.2.0.0
- scientific
- text
- unordered-containers
- vector
- yaml

View File

@ -17,6 +17,7 @@ module Autodocodec.Yaml
schemaChunksViaCodec,
schemaChunksVia,
jsonSchemaChunks,
jsonSchemaChunkLines,
-- * Instantiating @ToYaml@
toYamlViaCodec,

View File

@ -46,7 +46,11 @@ schemaChunksVia = jsonSchemaChunks . jsonSchemaVia
-- | Render a 'JSONSchema' as 'Chunk's
jsonSchemaChunks :: JSONSchema -> [Chunk]
jsonSchemaChunks = concatMap (\l -> l ++ ["\n"]) . go
jsonSchemaChunks = unlinesChunks . jsonSchemaChunkLines
-- | Render a 'JSONSchema' as lines of 'Chunk's
jsonSchemaChunkLines :: JSONSchema -> [[Chunk]]
jsonSchemaChunkLines = go
where
indent :: [[Chunk]] -> [[Chunk]]
indent = map (" " :)

View File

@ -266,7 +266,7 @@ data NumberBounds = NumberBounds
{ numberBoundsLower :: !Scientific,
numberBoundsUpper :: !Scientific
}
deriving (Show, Eq, Generic)
deriving (Show, Eq, Ord, Generic)
instance Validity NumberBounds