Skip to main content
Filter by
Sorted by
Tagged with
Tooling
0 votes
1 replies
106 views

For fun, I developed an AI model with short-term, medium-term, and long-term memory, inspired by neuro-sama. (I'm a regular backend developer, I don't know much about AI). How it works: mic -> vad -...
yxtiblya's user avatar
0 votes
1 answer
53 views

I sucessfully compiled SML using the instructions from here and I try to execute this CML hello world program: % cat cml_test.cm Library structure Hello is $cml/basis.cm $cml/cml.cm ...
alinsoar's user avatar
  • 15.9k
0 votes
1 answer
73 views

Here is a basic implementation of the tokens function: fun f c = c = #" "; val testStr = "int main(){return 42;}"; val stringL = String.tokens f testStr; It returns: val stringL = ...
Jace Ziegler's user avatar
0 votes
0 answers
105 views

In SOSML Write the following ML functions using, whenever possible, pattern-matching function definitions. Function union of type 'a list * 'a list → 'a list that returns the union of two lists (in ...
Brandon Swallow's user avatar
1 vote
1 answer
90 views

I create a datatype and a function. The function must be able to do a multiplication according to whether the members of the pair are int(s) or real(s). I can get to work for Int, but when I add a ...
Hank Lenzi's user avatar
2 votes
2 answers
299 views

My old notes on ML say that let (𝑣₁, … , 𝑣ₙ) = (𝑡₁, … , 𝑡ₙ) in 𝑡′ is a syntactic sugar for (λ 𝑣ₙ. … (λ 𝑣₁. 𝑡′)𝑡₁ … )𝑡ₙ and that let (𝑣₁, 𝑣₂) = 𝑡 𝑡′ in 𝑡″ is equivalent to let 𝑣 = 𝑡 ...
user avatar
1 vote
1 answer
64 views

I'm currently learning Standard ML, just for fun; What I'm trying to do is generate a list of 3-tuples of random ints between 1 and 100. My code: fun reload() = use "filtertest.sml"; fun ...
OrangeCalx01's user avatar
0 votes
2 answers
88 views

Define a recursive predicate in ML isRelationSymmetric that accepts a relation r (represented as a list of tuples) and returns true if r is symmetric and false otherwise. Here is what I have so far. ...
jwolf's user avatar
  • 33
-1 votes
1 answer
246 views

I need help figuring out what I need to do for the helper function recursively, I am kinda lost of in what I need to do for the helper function. Here is the question and the example input. Here is ...
jwolf's user avatar
  • 33
0 votes
2 answers
75 views

SML is a challenging language for me to learn. I'm trying to find a way to screen an undetermined list and return a boolean based on whether two elements adjacent on a list are the same value or not. ...
aStudentinLearning's user avatar
0 votes
1 answer
275 views

I'm new to ML, and a bit of my code isn't working. I'm creating a function in ML where it's supposed to sort reals and then compile them into a single list. I created a large if-then statement, but it ...
aStudentinLearning's user avatar
1 vote
1 answer
274 views

Apologies if this is considered a dumb question, but how can I make an Isabelle theory recognise ML code? For example, let's say I have an Isabelle file that looks like ML ‹ type vec = real * real; ...
Kookie's user avatar
  • 345
5 votes
0 answers
141 views

I'm working on an implementation of the HMF type system described in this paper by Daan Leijen. The inference algorithm for HMF is defined in section 6.3. Here is the rule for let expressions (...
Owen Bechtel's user avatar
1 vote
1 answer
205 views

If I'm trying to do this: Convert #”N” to a real What ML expression would do this? In the same way that:\ str = Char -> string chr = int -> Char ord = Char -> int real = int -> real Is ...
Powerrangers123's user avatar
2 votes
2 answers
2k views

I understading than x == y is false because each is instantiated in different memory locations (https://stackoverflow.com/a/1412688/11439260). But i expected than a == b is false. Why this is true? ...
aspeddro's user avatar
3 votes
1 answer
359 views

fun parse file = let (* A function to read an integer from specified input. *) fun readInt input = Option.valOf (TextIO.scanStream (Int.scan StringCvt.DEC) input) in ...
tonythestark's user avatar
0 votes
1 answer
71 views

fun max (xs : int list)= if null xs then NONE else let val tl_ans = max(tl xs) in if isSome tl_ans andalso valOf tl_ans > hd xs then tl_ans else ...
Antutu Cat's user avatar
2 votes
1 answer
221 views

It seems that only a * b can fit in to _ and only (a,b) can fit in to (a,_). I can imagine that a*b is a proper type for the internal product with components a and b whereas (a,b) is a external ...
nicolas's user avatar
  • 9,845
2 votes
2 answers
204 views

i need your help please, where is the error in my code ? let create = Array.make_matrix 10 10;; let assoc int = create int,create (char_of_int int);; the error is 3 | let assoc int = create int,...
Greedosaur's user avatar
0 votes
1 answer
73 views

I am brand new to learning standard ML. I want to make a function that takes a list/lists of 3 numbers and deletes the middle number and then reverse the order of the two numbers. So if I have a ...
auditornwann's user avatar
0 votes
1 answer
885 views

I've searched and found several people asking this question, but I can't find an explicit answer. How can I print a non-string in sml? For example if I have an instance of an ADT, i.e., of a type ...
Jim Newton's user avatar
0 votes
1 answer
188 views

I'm brand new to ML and I'm trying to figure out the syntax for pattern matching. Can someone help me understand the compiler error, and the correct syntax for pattern matching an AssignStm while ...
Jim Newton's user avatar
2 votes
1 answer
170 views

I have an embedded ML code like this: ML ‹ val boo = true; val num = 1234; val rea = 3.14; val str = "hi"; › Can anyone give me an example of code that gets those values from HOL?
notooth's user avatar
  • 31
0 votes
1 answer
530 views

I am trying to build a function in Ocaml which parses a list of lists, eg from [[0;1];[3;4;8]] to [0;1;3;4;8]. I tried to do something like: #let rec parse listoflists= match listoflists with [[]...
Ana Palea's user avatar
11 votes
1 answer
2k views

I am not sure I understand the difference between the delimited continuation operator pairs prompt/control and reset/shift. I understand some basic examples of use, but in those examples their ...
johjs's user avatar
  • 111

1
2 3 4 5
14