672 questions
1
vote
1
answer
451
views
How to create a function in ML using a Recursive Datatype
Given the datatypes:
datatype bunch = One of int
| Group of bunch list;
datatype 'ex bunch = NIL
| One of 'ex
| Group of 'ex * 'ex bunch;
How can ...
5
votes
3
answers
609
views
Deriving type expression in ML
All,
I want to derive the type expression for the function below in ML:
fun f x y z = y (x z)
Now I know typing the same would generate the type expression. But I wish to derive these values by hand....
5
votes
4
answers
2k
views
Explain ML type inference to a C++ programmer
How does ML perform the type inference in the following function definition:
let add a b = a + b
Is it like C++ templates where no type-checking is performed until the point of template instantiation ...
1
vote
1
answer
2k
views
Insert element into a tree from a list in Standard ML
I have just started to learn SML on my own and get stuck with a question from the tutorial.
Let say I have:
tree data type
datatype node of (tree*int*tree) | null
insert function
fun insert (...
0
votes
1
answer
213
views
Ml file reading limits
I want to read from file but, when I use inputAll or inputLine, it read only 70 character from each line.
how can I read from file without limitation ?
29
votes
6
answers
25k
views
ML IDE and Compiler for Windows or Linux or Mac
I have to write some code in ML and it is my first time I`m going to use the language.
Is there any Development Environment for Standard ML? (preferably under Windows). I tried googling but all I ...
25
votes
2
answers
2k
views
Inferred type appears to detect an infinite loop, but what's really happening?
In Andrew Koenig’s An anecdote about ML type inference, the author uses implementation of merge sort as a learning exercise for ML and is pleased to find an “incorrect” type ...
5
votes
6
answers
4k
views
Getting started with Standard ML
I'm looking for some kind of "ML for beginners" guide - google has led me to some obscure mailing lists or way-over-my-head texts so far.
The problem is, I have zero functional programming experience ...
4
votes
3
answers
1k
views
Editor for programming ML on windows?
I know I can use Emacs but I haven't used it earlier... are there any other alternatives??
Thanks
107
votes
2
answers
21k
views
What are the differences between SML and OCaml? [closed]
What sets the two ML dialects apart?
3
votes
3
answers
2k
views
How do I use the Queue library in SML/NJ
I see that the SML/NJ includes a queue structure. I can't figure out how to use it. How do I use the additional libraries provided by SML/NJ?