caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] module typing issue
@ 2011-03-25  8:34 Joel Reymont
  2011-03-25  8:44 ` [Caml-list] " Joel Reymont
  0 siblings, 1 reply; 20+ messages in thread
From: Joel Reymont @ 2011-03-25  8:34 UTC (permalink / raw)
  To: caml-list

ocamlc x.ml 
File "x.ml", line 30, characters 16-28:
Error: Unbound value Rep.dispatch

Is there a way to make this work?

	Thanks, Joel

--- x.ml
module type Message = 
sig 
  type obj 
  type variant
  val make : unit -> obj
  (* encapsulate object in a variant type *)
  val convert : obj -> variant
  val print : obj -> unit
end

module type Request = 
sig 
  include Message
end

(* dispatches based on a request *)

module type Reply = functor (Req : Request) ->
sig 
  include Message
  val dispatch : Req.variant -> obj
end

module Server (Req : Request) (Rep : Reply) =
struct 
  let server = 
    while true do
      let req = Req.make () in
      let var = Req.convert req in
      let rep = Rep.dispatch var in
      Req.dump req;
      Rep.dump rep
    done
end

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-03-28 12:39 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25  8:34 [Caml-list] module typing issue Joel Reymont
2011-03-25  8:44 ` [Caml-list] " Joel Reymont
2011-03-25 14:17   ` Joel Reymont
2011-03-25 15:46     ` Andreas Rossberg
2011-03-25 15:57       ` Joel Reymont
2011-03-25 16:04         ` Andreas Rossberg
2011-03-25 16:42       ` Guillaume Yziquel
2011-03-25 16:59         ` Andreas Rossberg
2011-03-25 19:01           ` Guillaume Yziquel
2011-03-25 19:13             ` Andreas Rossberg
2011-03-28  7:53             ` Alain Frisch
2011-03-28 10:33               ` Guillaume Yziquel
2011-03-28 11:29                 ` David Allsopp
2011-03-28 11:58                   ` Guillaume Yziquel
2011-03-28 12:11                     ` David Allsopp
2011-03-28 12:29                       ` Guillaume Yziquel
2011-03-28 12:23                     ` Alain Frisch
2011-03-28 12:39                       ` Guillaume Yziquel
2011-03-28 11:32               ` David Allsopp
2011-03-28 12:02                 ` Guillaume Yziquel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).