the-sett/salix/1.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.

cleanupName "type" == "type_"
safeCCU : 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.

cleanupName "type" == "type_"

The name is put into camel case starting with an upper case letter.

safeCCL : 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.

cleanupName "type" == "type_"

The name is put into camel case starting with a lower case letter.

Sort things by name.

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

Sorts a list of named things.

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

Sorts an non-empty list of named things.