vapourlang / vapour

Typed superset of R
http://vapour.run
Apache License 2.0
190 stars 3 forks source link

A typed superset of the R programming language

Docs | Get Started | Install

[!WARNING]
Vapour is in (very) early alpha!

type person: object {
   age: int,
   name: char 
}

func create(name: char): person {
  return person(name = name)
}

@generic
func (p: any) set_age(age: int, ...: any): any

@default
func(p: any) set_age(age: int): null {
  stop("not implemented")
}

func(p: person) set_age(age: int): person {
  p$age = age
  return p
}

let john: person = create("John") |>
  set_age(36)