Code sample:
Actor model with explicit synchronicity and access scoping:
actor Counter {
var value = 0;
public func inc() : async Nat {
value += 1;
return value;
};
}
Types and specificity: type Tree<T> = {
#leaf : T;
#branch : {left : Tree<T>; right : Tree<T>};
};
func iterTree<T>(tree : Tree<T>, f : T -> ()) {
switch (tree) {
case (#leaf(x)) { f(x) };
case (#branch{left; right}) {
iterTree<T>(left, f);
iterTree<T>(right, f);
};
}
}
Source: https://sdk.dfinity.org/docs/language-guide/motoko.htmlNot to my taste personally.