Comment

The Valkyrie language uses # for line comments, #! for shebangs, #? for documentation comments.

#! /usr/bin/env vk

# This is a line comment

#? This is a documentation comment
type MyResult<T = ()> = Result<T, MyError>

Literals

Here are some primitive types:

AtomExample
Booleantrue, false
Integer0, 0u8, 0int
Decimal0.0, 0.0f32, 0.0dec
Character'n', '\n'
String"", "Hello world!"

Here are some common collections:

CollectionExample
ListList(), [1, 2, 3]
DictDict(), [a: 1, z: 26]
Tuple(), (1,), (1, "Hello")
OptionNone, Some(1)
ResultSuccess(1), Failure("Error")

Literal polymorphism

The content represented by the literal value will be affected by the type on the left

let string: str = "c"
let char: char = "c"
let list: List[String] = []
let dict: Dict[String] = []