He's an example of a schema used to specify what sorts of configuration files this demo expects and how they will be processed into a Haskell value
demoSpec :: ValueSpecs (Maybe [Rational], Maybe Bool, Maybe T.Text, [(Int,Int)]) demoSpec = sectionsSpec "top-level configuration" $ do nums <- optSection' "numbers" (oneOrList valuesSpec) "Try out the number syntax" bool <- optSection' "yes-or-no" yesOrNoSpec "Using atoms as enumerations" str <- optSection "string" "Strings use Haskell syntax" xs <- reqSection' "coordinates" (oneOrList nestedMapSpec) "Example required section of a nested map" return (nums,bool,str,xs) nestedMapSpec :: ValueSpecs (Int, Int) nestedMapSpec = sectionsSpec "coord" $ do x <- reqSection "x" "x coordinate" y <- reqSection "y" "y coordinate" return (x,y)
This documentation was generated from the specification above when you loaded the page.
show (generateDocs demoSpec)
Try changing this configuration file to see various error messages. The file format is described in detail in the module documentation.
Clicking parse will either generate a lexer error, parser error, schema error, or successfully extracted Haskell value.