OCaml gets crazy about types

时间:2015-12-08 19:26:13

标签: ocaml

I declared the following function in the interface

$STDEVInputFile[$Y].td

Now I try to call

type t
val empty : t
val mem : int -> t -> bool

But what I get is

open ISet
open OUnit2
open Printf
open List
(* ... *)
let s = mem 8 empty

What the heck is going on?? I even explicitly define the types in the .ml file

This expression has type ISet.t but an expression was expected of type
     int list

1 个答案:

答案 0 :(得分:2)

你可以提供更多代码吗? t是一个抽象类型,所以我猜你必须定义它。我怀疑mem不是正确的mem并指向List.mem。