Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.52 KB | None | 0 0
  1. module type S = sig
  2.   type t = [`A of int | `B of int]
  3.   val f : [>`A of int] -> int
  4. end
  5.  
  6. module M : S = struct
  7.   type t = [`A of int | `B of int]
  8.   let f (`A i) = i
  9. end
  10.  
  11. (*
  12.  
  13. Error: Signature mismatch:
  14.        Modules do not match:
  15.          sig
  16.            type t = [ `A of int | `B of int ]
  17.            val f : [< `A of 'a ] -> 'a
  18.          end
  19.        is not included in
  20.          S
  21.        Values do not match:
  22.          val f : [< `A of 'a ] -> 'a
  23.        is not included in
  24.          val f : [> `A of int ] -> int
  25.  
  26. *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement