[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2005-06-22 (06:48) |
From: | Pietro Abate <Pietro.Abate@a...> |
Subject: | Re: [Caml-list] type troubles with functors |
what about module type OrderedType = sig type t val compare : t -> t -> int end module type S = sig type elt type t type set val to_list : t -> elt list val to_set : t -> set end module Make (Ord : OrderedType) : S = struct module EltSet = Set.Make(Ord) type elt = EltSet.elt type set = EltSet.t type t = { l : elt list; s : set } let to_list t = t.l let to_set t = t.s end I'm far to be an expert, but this (or something similar) should work. p -- ++ Blog: http://blog.rsise.anu.edu.au/?q=pietro ++ ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html