schala/schala-lang/language/source-files/prelude.schala

23 lines
475 B
Plaintext
Raw Normal View History

let _SCHALA_VERSION = "0.1.0"
2018-11-05 20:55:03 -08:00
type Option<T> = Some(T) | None
type Ord = LT | EQ | GT
2018-11-06 03:02:32 -08:00
2021-11-02 16:56:12 -07:00
@register_builtin(print)
fn print(arg) { }
@register_builtin(println)
fn println(arg) { }
@register_builtin(getline)
fn getline(arg) { }
2018-11-06 03:02:32 -08:00
fn map(input: Option<T>, func: Func): Option<T> {
if input {
2021-11-14 02:43:48 -08:00
is Option::Some(x) then Option::Some(func(x))
is Option::None then Option::None
2018-11-06 03:02:32 -08:00
}
}
type Complicated = Sunrise | Metal { black: bool, norwegian: bool } | Fella(String, Int)