Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ml > type constructo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 952 of 968
Post > Topic >>

type constructor XXX would escape its scope

by kenzhu2000@[EMAIL PROTECTED] Apr 14, 2008 at 02:05 PM

I have two ml files: a.ml and b.ml.

In a.ml, I have:

module type Spec =
sig
 type t
 val transform : t -> float
end

module Make (Spec : Spec) = struct
 let start mystream =
       Stream.map (IData.app Spec.transform) mystream
end

In b.ml, I have:

module MySpec : A.Spec =
struct
 type t = string
 let transform x = float_of_string x
end

module B = A.Make(MySpec);;

B.start f;;  (* this is where the error occurs *)

Stream and IData are two modules defined in two other seperate files:
stream.ml and iData.ml.
Stream has function map which is similar to List.map and IData has
function app that
applies a function to a value.

f has type string IData Stream. My a.ml could compile fine. Compiling
b.ml with a.cmi
gives the following error:

This expression (f) has type string IData.t Stream.t
but is here used with type MySpec.t IData.t Stream.t
The type constructor MySpec.t would escape its scope

What is really wrong here? I suspect it is because of the two separate
files stream.ml
and iData.ml that I have... Thanks!
 




 2 Posts in Topic:
type constructor XXX would escape its scope
kenzhu2000@[EMAIL PROTECT  2008-04-14 14:05:30 
Re: type constructor XXX would escape its scope
rossberg@[EMAIL PROTECTED  2008-04-16 04:31:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:13:06 CDT 2008.