aeson-schema-0.3.0.5: Haskell JSON schema validator and parser generator

Safe HaskellNone
LanguageHaskell98

Data.Aeson.Schema.Helpers

Synopsis

Documentation

vectorUnique :: Eq a => Vector a -> Bool Source

 Tests whether all items in a vector are different from each other.

formatValidators :: [(Text, Maybe (Text -> Maybe String))] Source

 List of format validators. Some validators haven't been implemented yet. Those which are implemented take a Text value and return an error in case the input is invalid.

validateFormat Source

Arguments

:: Text

format

-> Text

input

-> Maybe String

message in case of an error

Validates a Text value against a format.

isDivisibleBy :: Scientific -> Scientific -> Bool Source

 Tests whether the first number is divisible by the second with no remainder.

replaceHiddenModules Source

Arguments

:: Data a 
=> a

Dec or Exp

-> a 

Workaround for an issue in Template Haskell: when you quote a name in TH like 'Text (Data.Text.Text) then TH searches for the module where Text is defined, even if that module is not exported by its package (in this case Text is defined in Data.Text.Internal). This works when we use TH to insert some code in a module but not when we use the TH code for pretty-printing.

cleanPatterns :: Data a => a -> a Source

 Workaround for a bug in Template Haskell: TH parses the empty list constructor in patterns as ConP (mkName "Prelude.[]") [] instead of ListP []

getUsedModules :: Data a => a -> [String] Source

 Extracts a list of used modules from a TH code tree.