如何用ML编译器编译类别代码?

时间:2014-02-06 05:33:45

标签: haskell ocaml ml

发现有很多ML编译器我不知道哪个编译器适合这些代码,并且不知道如何编译它

并发现haskell具有适合类别使用的operads包 是否可以翻译成haskell?

cs.man.ac.uk/~david/categories/programs/cat

使用ocaml编译时出错

# #use "C:/Documents and Settings/wilson/My Documents/Downloads/ML/cat.ml";;
File "C:/Documents and Settings/wilson/My Documents/Downloads/ML/cat.ml", line 20, characters 13-14:
Error: Syntax error: operator expected.
# #use "C:/Documents and Settings/wilson/My Documents/Downloads/ML/functorcat.ml";;
File "C:/Documents and Settings/wilson/My Documents/Downloads/ML/functorcat.ml", line 12, characters 13-14:
Error: Syntax error: operator expected.
# #use "C:/Documents and Settings/wilson/My Documents/Downloads/ML/basic.ml";;
File "C:/Documents and Settings/wilson/My Documents/Downloads/ML/basic.ml", line 7, characters 15-16:
Error: Syntax error

1 个答案:

答案 0 :(得分:2)

您发布的链接不正确,实际上可以找到该文件here

它说明标题中哪种语言正确

(*                COMPUTATIONAL CATEGORY THEORY
                           Oct. 1987
               Programming Language: Standard ML    *)

所以你需要一个标准ML(SML)编译器。可能你需要一个与25年前编写的代码兼容的代码 - 你的猜测和我的猜测一样好,现代SML编译器是否能够编译这段代码。