Re: Problem binding type parameters in modules

From: Hendrik Tews (tews@irritatie.cs.kun.nl)
Date: Tue Jan 19 1999 - 09:50:03 MET


Date: Tue, 19 Jan 1999 09:50:03 +0100
Message-Id: <199901190850.JAA12869@irritatie.cs.kun.nl>
From: Hendrik Tews <tews@irritatie.cs.kun.nl>
To: caml-list@inria.fr
Subject: Re: Problem binding type parameters in modules
In-Reply-To: <199901161221.NAA00134@miss.wu-wien.ac.at>

Hi,
   
   My problem (example code):
   
   [omitted]

What about using abstraction? eg

    module type FOO1 =
    sig
      type 'a foo
      val empty : unit -> 'a foo
    end

    module Bar : FOO1 =
    struct
      type 'a foo = 'a list Lazy.t
      let empty () = lazy []
    end

Then empty is a function and its type gets generelized.

   The "'a" specified in "empty" is still not the same as in "'a foo". I have

The section about type checking in the list of "Frequently asked
Questions about Caml"
(http://caml.inria.fr/pub/old_caml_site/FAQ/FAQ_EXPERT-eng.html) explains the
differences between 'a and '_a.

Bye,

Hendrik



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:18 MET