Nanyx

Naming conventions

Recommended casing and identifiers

Nanyx uses camel case for values, functions, modules and tags, and Pascal case for types.

KindCaseExamples
Values and functionscamelCasemessage, sayHello, userCount
ModulescamelCaseuserManagement, collections.list
Types and contextsPascalCaseGreeter, Console, $UserId
TagscamelCase after ##ok, #notFound
Custom pattern tagsPascalCase after ##Hsl, #Even
-- Value

def message = "Hello world"

-- Function

def sayHello = { println("Hello!") }

-- Type

type Greeter = (greet: () -> ())

Because a record type alias is callable as a constructor (see Constructing records from a type alias), a Pascal-cased name in expression position is almost always such a constructor: Point(x = 1, y = 2).

Custom patterns use Pascal case after the # so that they are visually distinct from ordinary tags; see Custom patterns.