Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

MLscript

< >

MLscript is a programming language created in 2020 by Luyu Cheng and Lionel Parreaux.

#1624on PLDB 4Years Old
Download source code:
git clone https://github.com/hkust-taco/mlscript/
REPLSource Code

A step towards rethinking pattern matching to make it more powerful and natural to use.


Example from the web:
type List[A] = Cons[A] | Nil class Cons[out A](head: A, tail: List[A]) { fun map: (A -> 'B) -> List['B] map(f) = Cons of f(head), tail.map(f) } module Nil { fun map(f) = Nil } fun (::) cons(x, xs) = Cons(x, xs) fun show(xs) = let rec go(xs) = if xs is Cons(h, Nil) then String(h) Cons(h, t) then join(String(h), ", ", go(t)) Nil then "" join("[", go(xs), "]") let xs = 1 :: 2 :: 3 :: Nil show(xs) show(xs.map of x => succ(x))
- Build the next great programming language Add About Search Keywords Livestreams Labs Resources Acknowledgements Part of the World Wide Scroll