-
as seen on Stack Overflow
- Search for 'Stack Overflow'
i am a newbie learning sml and the question i am thrown with involves IO functions that i have no idea how it works even after reading it. Here is the 2 questions that i really need help with to get me started, please provide me with codings and some explaination, i will be able to trial and error…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have this below function and it works
(fn x => x * 2) 2;
but for this below one, it is not working
(fn x y => x + y ) 2 3;
can anyone tell me why? or help give me some hint to get it to work.
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
hi,
i wrote a function wich works as expected but i don't understand why the output is like that.
function
datatype prop = Atom of string | Not of prop | And of prop*prop | Or of prop*prop;
(* XOR = (A And Not B) OR (Not A Or B) *)
local
fun do_xor (alpha,beta) = Or( And( alpha, Not(beta) )…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
how do i prompt for user input in a running function?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
i need help enumerating all possible combinations of length n given a list of strings.
example, if my list was ["r","b","g"] and int 2
answer:
r r,
r b,
r g,
b r,
b b,
b g,
g r,
g b,
g g,
>>> More