Skip to content

Instantly share code, notes, and snippets.

@raphael-proust
Created March 25, 2011 08:48
Show Gist options
  • Save raphael-proust/886559 to your computer and use it in GitHub Desktop.
Save raphael-proust/886559 to your computer and use it in GitHub Desktop.
ocamlc x.ml
File "x.ml", line 30, characters 16-28:
Error: Unbound value Rep.dispatch
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment