MLtalk Book
This book is an official documentation of MLtalk programming
language. MLtalk is basically based on ML, but there's
little bit extended original features.
Programming languages that inspires MLtalk is not limited ML
only. There's Icon, Pascal and Rust. So, MLtalk is absorbed
essence of many paradigm.
Let's go out to funny journey on MLtalk's world!
01. Installation
You have to install interpreter of MLtalk for use it. You can puts below install commands on your shell
curl -s "https://kajizukataichi.github.io/MLtalk/installer.sh" | sh
If installing is finished successfully, you can puts just a
mltalk
binary name to start up MLtalk's REPL
(Read-Evaluate-Print-Loop).
You can use MLtalk using REPL interactively looks like
talking with computer is origin of it's called "MLtalk"
02. Function
Function is base of functional programming. In MLtalk, you can define and apply function like below.
let inc n = n + 1;
bind inc = fn(num -> num);
inc 5
In line 1 defines function called inc
takes
argument n
. And, in line 2 binds
inc
as function that recieves type
num
and returns number too.
Totally, That code returns 6 because 5 is applied by
inc
function to plus 1.
03. Effect
In MLtalk, cusing side-effect is not allowed in pure
function.
Features with side-effect are standard I/O
(such as print
, input
), external
resource reading (such as load
,
readFile
) etc.
Side-effects must be explicitly specified using
effect
statement.
effect print "Hello!"
All functions are pure in default. To define function with
side-effect, you can define it inside the
effect
statement. When applying too
Sorry, This book is still mid flow of writing. You can contribute it as document mentainer if you have interest