我知道这个问题之前已经被问过了,但以前的问题都没有答案为我工作,所以我会尝试一种不同的方法。 我已经做到了这一点: > datatype which = STRING of string | INT of int;
datatype which = INT of int | STRING of string
> datatype whichTree = Empty | Leaf of whic
我正在阅读在线书籍“计算分类理论”http://www.cs.man.ac.uk/~david/categories/book/book.pdf,本书中存在问题2.10的一些问题。特别是随着powerset的定义。 abstype 'a Set = set of 'a list
with val emptyset = set([])
fun is_empty(set(s)) =
我是一个newby。我写下面的代码。 Delay(e) == fn() => e
Force(e) == e()
fun time_consuming(n) =
let fun tak(x, y, z) = if x <= y then y
else tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y))
in
f
我们接下来dayatype: 和两个功能: - val real =
fn (Rec(x,y)) => x
| (Polar(r,a)) => r * Math.cos(a);
val real = fn : complex -> real
- val imaginary =
fn (Rec(x,y)) => y
| (Polar(r,a)) => r * Math.sin(