Mode:
Duration:
1
2
3
4
5
6
val lst = [1,2,3,4,5];
fun sum [] = 0
| sum (x::xs) = x + sum xs;
val result = sum lst;
print(Int.toString(result) ^ "\n");Coding works best on desktop or with an external keyboard.
val lst = [1,2,3,4,5];
fun sum [] = 0
| sum (x::xs) = x + sum xs;
val result = sum lst;
print(Int.toString(result) ^ "\n");Coding works best on desktop or with an external keyboard.
Calculates the sum of a list.
val lst = [1,2,3,4,5];
fun sum [] = 0
| sum (x::xs) = x + sum xs;
val result = sum lst;
print(Int.toString(result) ^ "\n");ML (Meta Language) is a functional programming language known for its strong static type system, type inference, and pattern matching capabilities. It emphasizes immutability, recursion, and expressive type-safe programming, making it ideal for symbolic computation, theorem proving, and compiler development.
Origin & Creator
ML was developed in the early 1970s by Robin Milner and colleagues at the University of Edinburgh as a metalanguage for the LCF theorem prover.
Industrial Note
ML influenced many functional languages like OCaml, F#, and Haskell. It is still used in formal methods, compiler construction, and language research.