sml Questions
8
I'm using Mac OSX 10.7.5 and I can't seem to get download a working Standard ML compiler with a REPL available. Is this supposed to be so difficult? Is there a best ML that I should be downloading....
Stephanstephana asked 26/9, 2013 at 9:17
3
Solved
The following SML code is taken from a homework assignment from a course at University of Washington. (Specifically it is part of the code provided so that students could use it to complete Homewor...
Unpleasant asked 13/8, 2022 at 5:50
5
Solved
I have this code to filter list of string that the first letter is capital:
fun f s = Char.isUpper(String.sub(s,0));
fun only_capitals (xs : string list) = List.filter(f , xs);
But when compile, I...
2
I've been using vim for editing code for some time and now I want to use it effectively for programming in Standard ML. In emacs one can use sml-mode which allows one to open the SML intepreter (Mo...
Pitiful asked 15/9, 2012 at 21:52
3
Solved
I'm learning ML, with the SML/NJ dialect. What I'm trying to figure out is if there is a line comment operator. I found the block comment operator, (* ... *), but I really miss line comments.
Sug...
1
Suppose we have the following toy binary tree structure:
datatype Tree = Leaf | Branch of Tree * Tree
fun left(Branch(l,r))= l
fun right(Branch(l,r))= r
And suppose that we have some large and exp...
Slifka asked 14/5, 2020 at 11:39
1
According to David MacQueen in his Reflections on Standard ML report1,
Lexically-scoped infix directives were an ill-advised legacy from Pop-2. They complicate parsing and they do not work well wi...
Pacifica asked 6/6, 2021 at 0:8
2
Solved
Since RosettaCode's Standard ML solution is a very slow version of Quicksort according to the question (and discussion) "Why is the minimalist, example Haskell quicksort not a "true" quic...
1
Solved
Dependent type systems seem to support some of the uses of a ML module system. What do you get out of a module system that you do not get out of dependent records?
module ~ record
signature ~ rec...
3
Solved
I started learning Standard ML recently out of curiosity. So what I know is that is has an efficient compiler (MLton) which allows us to freely use abstractions without worrying about performance.
...
Gymnasium asked 11/10, 2009 at 5:28
4
According to my programming language class, in a language that uses lexical scoping
The body of a function is evaluated in the environment where the
function is defined, not the environment ...
1
Solved
I'm completely new to SML and I don't understand what am I supposed to do in order to create, edit, compile and run an sml file with PolyML. I'm using Windows and I don't know if I need to download...
4
Solved
I'd like to find out concise, functional and tail-recursive (if possible) way of implementing the below specified function:
(define (make-domain digits dimension)
;; Implementation)
;; Usage
(make...
Exceptive asked 6/7, 2020 at 20:47
5
Solved
Are there standard sorting functions in SML? The documentation on the Internet is so scarce I couldn't find any.
Schmid asked 19/1, 2013 at 6:42
3
Solved
My question is if there is any difference between Standard ML's module system and OCaml module system? Has OCaml all the support of functors , ascriptions etc... that SML has?
3
Solved
I'm writing a "script" in Standard ML (SML/NJ) that sets up the interactive environment to my liking. The last thing the script does is print out a message indicating everything went smoothly. Esse...
4
I need to construct an undirected graph. I don't need it to do anything too fancy, but ideally it would work like this:
structure UDG = UndirectedGraph
val g = UDG.empty
val g = UDG.addEdges(g, n1...
Baccate asked 6/9, 2009 at 20:4
0
In section 23.8 of his book Types and Programming Languages, Benjamin C. Pierce writes the following:
Another well-studied restriction of System F is rank-2 polymorphism, introduced by Leivant (...
Nitramine asked 4/9, 2018 at 16:27
1
Solved
I have recently been learning SML, when I came to know the terms - applicative and generative functors. I also know that SML uses generative functors.
I tried to Google the terms but couldn't find...
Osteopathy asked 4/9, 2018 at 7:31
3
Solved
I am using New Jersey SML on Windows. If test.sml is an SML file I can execute it by running this at a Windows command prompt:
C:\> sml test.sml
I then get the usual SML output and a new SML ...
1
Solved
I'm using SML/NJ, and I need to use a set of functions that are in a certain file f1.sml inside another file f2.sml.
However, I'm not running f2.sml directly, rather, I'm importing it from somewhe...
4
Solved
I am new to SML.
How do I use the AND operator inside IF statements?
Here is my code:
val y = 1;
val x = 2;
if (x = 1 AND y = 2) then print ("YES ") else print("NO ");
My error is:
stdIn:66.9-67...
3
Solved
In SML, is it possible for you to have multiple patterns in one case statement?
For example, I have 4 arithmetic operators express in string, "+", "-", "*", "/" and I want to print "PLUS MINUS" of...
4
Solved
I just started learning functional programming in SML and I want to know how I can combine the following two functions into a single function. The function isolate deletes the duplicates of a list ...
Adorn asked 12/1, 2014 at 16:39
5
Solved
I am suddenly in a recursive language class (sml) and recursion is not yet physically sensible for me. I'm thinking about the way a floor of square tiles is sometimes a model or metaphor for intege...
Erythromycin asked 6/10, 2017 at 19:13
1 Next >
© 2022 - 2025 — McMap. All rights reserved.