the-sett/salix/4.0.0

NOTE: the latest version is 4.0.3

Naming

Helper functions for working with names in source code.

Check names are valid.

checkName : String -> Bool

Checks that a name starts with an alpha character, and is followed only by alpha and numeric characters.

Build valid names.

safeName : String -> String

Checks if a name matches an Elm keyword, and proposes a different name to use instead, which is the original with an underscore appended.

safeName "type" == "type_"
safeCCU : String -> String

CCL stands for camel-case-upper. This puts a name into camel case upper format.

Additional it checks if the name matches an Elm keyword, and proposes a different name to use instead, which is the original with an underscore appended.

safeCCL "type" == "Type_"


safeCCL "someVar" == "SomeVar"


safeCCL "MyList" == "MyList"
safeCCL : String -> String

CCL stands for camel-case-lower. This puts a name into camel case lower format.

Additional it checks if the name matches an Elm keyword, and proposes a different name to use instead, which is the original with an underscore appended.

safeCCL "type" == "type_"


safeCCL "someVar" == "someVar"


safeCCL "MyList" == "myList"

Sort things by name.

sortNamed : List ( String, a ) -> List ( String, a )

Sorts a list of named things alphabetically.

sortNonemptyNamed : Nonempty ( String, a, b ) -> Nonempty ( String, a, b )

Sorts an non-empty list of named things alphabetically.