Syntax Reference
Syntax Reference
Use this page when you want a compact reminder rather than a tutorial.
Modules
import Array from 'std:array'import { parseUser } from './user.fs'
export readUser = (path: String): User => parseUser(path)export type User = { id: String, name: String }Bindings
answer = 42{ name } = user[first, second] = itemsFunctions
add = (a: Number, b: Number): Number => a + bTypes
type User = { id: String, name: String }type Maybe<T> = T | NullControl flow
if (active) { 'yes' } else { 'no' }
match (value) { 'ok' => 'done' 'error' => 'failed'}Other important reminders
- blocks return their final expression
returnis not part of Draft 0.1- arrays and records are immutable
- generator arrows use
*() => { ... } defer exprcreates explicit laziness