jsons-to-schema-0.1.0.0: JSON to JSON Schema

Copyright(c) Gareth Tan 2017
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

JSONSchema.Draft4.Internal.Utils

Description

Assorted internal utilities.

Synopsis

Documentation

alt :: Alternative f => (a -> a -> a) -> f a -> f a -> f a Source #

Functions like an Applicative but keeps the Just value if it exists.

andMaybe :: [Maybe Bool] -> Maybe Bool Source #

Returns the and of the Just values or Nothing if there are no Justs

computeMaximumConstraints :: [Maybe Scientific] -> [Maybe Bool] -> (Maybe Scientific, Maybe Bool) Source #

The unification function for the integer constraints maximum and exclusiveMaximum. When unifying schemas the exclusiveMaximum may somestimes need to be modified based on the @maximum.

computeMinimumConstraints :: [Maybe Scientific] -> [Maybe Bool] -> (Maybe Scientific, Maybe Bool) Source #

The unification function for the integer constraints minimum and exclusiveMinimum. When unifying schemas the exclusiveMinimum may somestimes need to be modified based on the @minimum.

zipWithPadding :: a -> b -> [a] -> [b] -> [(a, b)] Source #

Zips a list but uses the default value if one list is longer than the other.

listToMaybeList :: [a] -> Maybe [a] Source #

Similar to listFromMaybe, but returns the entire list as a Just if it is not empty instead of only the first item.

setToMaybeSet :: Set a -> Maybe (Set a) Source #

Returns the entire set as a Just if it is not empty instead of only one item.

parseValue :: ByteString -> Value Source #

Parses a bytestring to a value.

printSchema :: Schema -> Text Source #

Converts a schema to text.