[{"name":"Checker","comment":" Implements a checker that ensures a data model is valid as a level 2\nconstruct.\n\n\n# Model checking.\n\n@docs check, ModelCheckingError, errorToString\n\n","unions":[{"name":"ModelCheckingError","comment":" The error cases the model checker can detect.\n","args":["pos"],"cases":[]}],"aliases":[],"values":[{"name":"check","comment":" Runs checks on an L1 model and lowers it to L2 if all the checks pass.\n","type":"L1.L1 pos -> ResultME.ResultME (Checker.ModelCheckingError pos) (L2.L2 pos)"},{"name":"errorToString","comment":" Converts model checking errors to strings.\n","type":"Checker.ModelCheckingError pos -> String.String"}],"binops":[]},{"name":"L1","comment":" Defines the level 1 language for data modelling.\n\n\n# The L1 data modelling AST.\n\n@docs Basic, Container, Type, Restricted, Declarable, L1\n\n\n# Properties that can be held against the L1 mode.\n\n@docs PropSpec, Property, Properties, PropSpecs\n@docs defineProperties, emptyProperties\n\n\n# Ref checking status - L1 is unchecked.\n\n@docs Unchecked\n\n\n# Helper functions for extracting info from the L1 model.\n\n@docs positionOfDeclarable, positionOfType, propertiesOfDeclarable\n\n","unions":[{"name":"Basic","comment":" The basic data types.\n","args":[],"cases":[["BBool",[]],["BInt",[]],["BReal",[]],["BString",[]]]},{"name":"Container","comment":" Containers for 0..n instances of some type.\n","args":["pos","ref"],"cases":[["CList",["L1.Type pos ref"]],["CSet",["L1.Type pos ref"]],["CDict",["L1.Type pos ref","L1.Type pos ref"]],["COptional",["L1.Type pos ref"]]]},{"name":"Declarable","comment":" Things that can be declared as named constructs.\n","args":["pos","ref"],"cases":[["DAlias",["pos","L1.Properties","L1.Type pos ref"]],["DSum",["pos","L1.Properties","List.Nonempty.Nonempty ( String.String, List.List ( String.String, L1.Type pos ref, L1.Properties ) )"]],["DEnum",["pos","L1.Properties","List.Nonempty.Nonempty String.String"]],["DRestricted",["pos","L1.Properties","L1.Restricted"]]]},{"name":"PropSpec","comment":" Defines the kinds of additional property that can be placed in the model.\n","args":[],"cases":[["PSString",[]],["PSEnum",["Enum.Enum String.String"]],["PSQName",[]],["PSBool",[]],["PSOptional",["L1.PropSpec"]]]},{"name":"Property","comment":" Allows additional properties from a variety of possible kinds to be placed\nin the model.\n","args":[],"cases":[["PString",["String.String"]],["PEnum",["Enum.Enum String.String","String.String"]],["PQName",["List.List String.String"]],["PBool",["Basics.Bool"]],["POptional",["L1.PropSpec","Maybe.Maybe L1.Property"]]]},{"name":"Restricted","comment":" Restricted forms that are subsets of the basic data types.\n","args":[],"cases":[["RInt",["{ min : Maybe.Maybe Basics.Int, max : Maybe.Maybe Basics.Int, width : Maybe.Maybe Basics.Int }"]],["RString",["{ minLength : Maybe.Maybe Basics.Int, maxLength : Maybe.Maybe Basics.Int, regex : Maybe.Maybe String.String }"]]]},{"name":"Type","comment":" The possible type constructs.\n","args":["pos","ref"],"cases":[["TUnit",["pos","L1.Properties"]],["TBasic",["pos","L1.Properties","L1.Basic"]],["TNamed",["pos","L1.Properties","String.String","ref"]],["TProduct",["pos","L1.Properties","List.Nonempty.Nonempty ( String.String, L1.Type pos ref, L1.Properties )"]],["TEmptyProduct",["pos","L1.Properties"]],["TContainer",["pos","L1.Properties","L1.Container pos ref"]],["TFunction",["pos","L1.Properties","L1.Type pos ref","L1.Type pos ref"]]]},{"name":"Unchecked","comment":" Indicates that the model has not been checked.\n","args":[],"cases":[["Unchecked",[]]]}],"aliases":[{"name":"L1","comment":" L1 is a list of unchecked declarables.\n","args":["pos"],"type":"List.List ( String.String, L1.Declarable pos L1.Unchecked )"},{"name":"PropSpecs","comment":" A set of additional property kinds that can or must be defined against\nthe model.\n","args":[],"type":"Dict.Dict String.String L1.PropSpec"},{"name":"Properties","comment":" A set of additional properties on the model.\n","args":[],"type":"Dict.Dict String.String L1.Property"}],"values":[{"name":"defineProperties","comment":" Defines a set of property specifications with possible defaults. The first argument is a\nlist of property specs, and the second is a list of default values.\n\nValues may appear in the second argument that are not in the first, in which case a specification\nfor them will be infered.\n\nValues in the second argument that are also in the first should be of the same kind, but will be\noverriden by the second argument if not.\n\n","type":"List.List ( String.String, L1.PropSpec ) -> List.List ( String.String, L1.Property ) -> ( L1.PropSpecs, L1.Properties )"},{"name":"emptyProperties","comment":" Creates an empty set of properties.\n","type":"L1.Properties"},{"name":"positionOfDeclarable","comment":" Gets the position context from a Declarable.\n","type":"L1.Declarable pos ref -> pos"},{"name":"positionOfType","comment":" Gets the position context from a Type.\n","type":"L1.Type pos ref -> pos"},{"name":"propertiesOfDeclarable","comment":" Gets the properties from a Declarable.\n","type":"L1.Declarable pos ref -> L1.Properties"}],"binops":[]},{"name":"L2","comment":" Defines the level 2 language for data models that have been checked for\nconsitency, and have been processed for general data modelling concerns without\nregard to specific code generation.\n\n\n# The L2 data modelling language.\n\n@docs L2\n\n\n# Ref checking status - L2 is checked.\n\n@docs RefChecked\n\n","unions":[{"name":"RefChecked","comment":" Indicates that named type in the model have been reference checked to\nenusure that they name something that actually exists.\n\nSome summary information of what they refer to is also cached during ref\nchecking.\n\n","args":[],"cases":[["RcEnum",[]],["RcRestricted",["L1.Basic"]],["RcSum",[]],["RcTUnit",[]],["RcTBasic",[]],["RcTNamed",[]],["RcTProduct",[]],["RcTEmptyProduct",[]],["RcTContainer",[]],["RcTFunction",[]]]}],"aliases":[{"name":"L2","comment":" The L2 model\n","args":["pos"],"type":"Dict.Dict String.String (L1.Declarable pos L2.RefChecked)"}],"values":[],"binops":[]},{"name":"L3","comment":" Defines the level 3 language for data models that have been annotated with\npredicates indicating that the model has particular features needed by particular\ncode generators. A level 3 language ensures the specific requirements for futher\nprocessing by a code generator are being met.\n\n\n# The L3 data modelling language.\n\n@docs L3\n\n\n# Defaulting of properties accross the data model, and APIs to read properties.\n\n@docs DefaultProperties, PropertiesAPI, PropertyGet, makePropertiesAPI\n\n\n# Definition of an L3 processor which creates some output from an L3 model.\n\n@docs Processor, PropCheckError, propCheckErrorToString\n\n","unions":[{"name":"PropCheckError","comment":" Once properties have been checked, then reading properties as per the property\nspecification should always succeed, since those properties have been verified to be\npresent and of the correct kind.\n\nIf reading a property fails, it is a coding error and should be reported as a bug.\nThis error type enumerates the possible properties bugs.\n\n","args":[],"cases":[["CheckedPropertyMissing",["String.String","L1.PropSpec"]],["CheckedPropertyWrongKind",["String.String","L1.PropSpec"]]]}],"aliases":[{"name":"DefaultProperties","comment":" Allows the default properties on parts of the model to be defined.\n","args":[],"type":"{ top : ( L1.PropSpecs, L1.Properties ), alias : ( L1.PropSpecs, L1.Properties ), sum : ( L1.PropSpecs, L1.Properties ), enum : ( L1.PropSpecs, L1.Properties ), restricted : ( L1.PropSpecs, L1.Properties ), fields : ( L1.PropSpecs, L1.Properties ), unit : ( L1.PropSpecs, L1.Properties ), basic : ( L1.PropSpecs, L1.Properties ), named : ( L1.PropSpecs, L1.Properties ), product : ( L1.PropSpecs, L1.Properties ), emptyProduct : ( L1.PropSpecs, L1.Properties ), container : ( L1.PropSpecs, L1.Properties ), function : ( L1.PropSpecs, L1.Properties ) }"},{"name":"L3","comment":" The L3 model\n","args":["pos"],"type":"{ properties : L1.Properties, declarations : Dict.Dict String.String (L1.Declarable pos L2.RefChecked) }"},{"name":"Processor","comment":" API for an L3 model processor.\n","args":["pos","err"],"type":"{ name : String.String, defaults : L3.DefaultProperties, check : L3.L3 pos -> ResultME.ResultME err (L3.L3 pos), errorToString : (pos -> String.String) -> pos -> err -> String.String }"},{"name":"PropertiesAPI","comment":" An API for supplying property readers for various parts of the data model.\n","args":["pos"],"type":"{ top : L3.PropertyGet, declarable : L1.Declarable pos L2.RefChecked -> L3.PropertyGet, field : L1.Properties -> L3.PropertyGet, type_ : L1.Type pos L2.RefChecked -> L3.PropertyGet }"},{"name":"PropertyGet","comment":" An API for reading properties of various expected kinds.\n","args":[],"type":"{ getStringProperty : String.String -> ResultME.ResultME L3.PropCheckError String.String, getEnumProperty : Enum.Enum String.String -> String.String -> ResultME.ResultME L3.PropCheckError String.String, getQNameProperty : String.String -> ResultME.ResultME L3.PropCheckError (List.List String.String), getBoolProperty : String.String -> ResultME.ResultME L3.PropCheckError Basics.Bool, getOptionalStringProperty : String.String -> ResultME.ResultME L3.PropCheckError (Maybe.Maybe String.String), getOptionalEnumProperty : Enum.Enum String.String -> String.String -> ResultME.ResultME L3.PropCheckError (Maybe.Maybe String.String) }"}],"values":[{"name":"makePropertiesAPI","comment":" Creates a properties API from a set of defaulted property specs, and an\nL3 model.\n","type":"L3.DefaultProperties -> L3.L3 pos -> L3.PropertiesAPI pos"},{"name":"propCheckErrorToString","comment":" Convert prop check errors to strings.\n","type":"L3.PropCheckError -> String.String"}],"binops":[]},{"name":"Naming","comment":" Helper functions for working with names in source code.\n\n\n# Check names are valid.\n\n@docs checkName\n\n\n# Build valid names.\n\n@docs safeName, safeCCU, safeCCL\n\n\n# Sort things by name.\n\n@docs sortNamed, sortNonemptyNamed\n\n","unions":[],"aliases":[],"values":[{"name":"checkName","comment":" Checks that a name starts with an alpha character, and is followed only\nby alpha and numeric characters.\n","type":"String.String -> Basics.Bool"},{"name":"safeCCL","comment":" Checks if a name matches an Elm keyword, and proposes a different name to\nuse instead, which is the original with an underscore appended.\n\n    cleanupName \"type\" == \"type_\"\n\nThe name is put into camel case starting with a lower case letter.\n\n","type":"String.String -> String.String"},{"name":"safeCCU","comment":" Checks if a name matches an Elm keyword, and proposes a different name to\nuse instead, which is the original with an underscore appended.\n\n    cleanupName \"type\" == \"type_\"\n\nThe name is put into camel case starting with an upper case letter.\n\n","type":"String.String -> String.String"},{"name":"safeName","comment":" Checks if a name matches an Elm keyword, and proposes a different name to\nuse instead, which is the original with an underscore appended.\n\n    cleanupName \"type\" == \"type_\"\n\n","type":"String.String -> String.String"},{"name":"sortNamed","comment":" Sorts a list of named things.\n","type":"List.List ( String.String, a ) -> List.List ( String.String, a )"},{"name":"sortNonemptyNamed","comment":" Sorts an non-empty list of named things.\n","type":"List.Nonempty.Nonempty ( String.String, a, b ) -> List.Nonempty.Nonempty ( String.String, a, b )"}],"binops":[]},{"name":"Templates.Elm","comment":" Elm code generation from L1 models.\n\nType declarations:\n\n@docs typeDecl, codec\n\nLowerings of L1 into Elm type annotations:\n\n@docs lowerType, lowerFun\n\n","unions":[],"aliases":[],"values":[{"name":"codec","comment":" Generates a Codec for an L1 type declaration.\n","type":"String.String -> L1.Declarable pos L2.RefChecked -> ( Elm.CodeGen.Declaration, Elm.CodeGen.Linkage )"},{"name":"lowerFun","comment":" Lowers an L1 function type into an Elm type annotation\n","type":"L1.Type pos L2.RefChecked -> L1.Type pos L2.RefChecked -> ( Elm.CodeGen.TypeAnnotation, Elm.CodeGen.Linkage )"},{"name":"lowerType","comment":" Lowers an L1 type into an Elm type annotation.\n","type":"L1.Type pos L2.RefChecked -> ( Elm.CodeGen.TypeAnnotation, Elm.CodeGen.Linkage )"},{"name":"typeDecl","comment":" Turns an L1 type declaration into Elm code.\n\nA type can result in a list of declarations - enums in addition to declaring a\ntype can also declare the permitted enum values.\n\n","type":"String.String -> Elm.CodeGen.Comment Elm.CodeGen.DocComment -> L1.Declarable pos L2.RefChecked -> ( List.List Elm.CodeGen.Declaration, Elm.CodeGen.Linkage )"}],"binops":[]}]