Playground
SML REPL
A miniature read-eval-print loop for Standard ML expressions. Try val bindings, fun definitions, and the builtin list operators.
REPL
SML Playground REPL — builtins: +, -, *, div, mod, =, <>, <, >, <=, >=, hd, tl, null, length, rev, @, ::
Try: 1 + 2 * 3 | val xs = [1,2,3,4,5] | fun fact n = if n = 0 then 1 else n * fact (n - 1)
Enter to run, Shift+Enter for newline, ↑/↓ for history
Examples
Environment
hdtlnulllengthrevfoldlfoldrmapfiltermapcanmemberappendexplodeimplodeMatchBindOverflowFailEmptyDivSubscriptSize
Syntax
val x = expr — bindfun f x = e — definefun f 0 = 1 | f n = n * f (n-1)expr — evaluate