Advertisement
Guest User

Recursive module weirdness

a guest
Jul 15th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 1.88 KB | None | 0 0
  1. module rec A_FF : sig
  2. (*Call the following comment A_FF-1*)
  3.  
  4. (*           val a : int -> int *)
  5.  
  6. (*And the following comment A_FF-2 *)
  7. (*           module B : functor (X : sig end) -> sig
  8.                val c : int -> int
  9.              end
  10.  *)
  11.          end
  12.   = struct
  13. (*Call the following comment A_FF-1*)
  14. (*    let a x = x + (A_FF.a x)*)
  15.  
  16. (*And the following comment A_FF-2 *)
  17. (*    module B (X : sig end)= struct
  18.         let c _ = 0
  19.       end
  20.  *)
  21. end
  22.  
  23.  
  24. module rec A_TF : sig
  25. (*Call the following comment A_TF-1*)
  26.  
  27.            val a : int -> int
  28.  
  29. (*And the following comment A_TF-2 *)
  30. (*           module B : functor (X : sig end) -> sig
  31.                val c : int -> int
  32.              end
  33.  *)
  34.          end
  35.   = struct
  36. (*Call the following comment A_TF-1*)
  37.     let a x = x + (A_TF.a x)
  38.  
  39. (*And the following comment A_TF-2 *)
  40. (*    module B (X : sig end)= struct
  41.         let c _ = 0
  42.       end
  43.  *)
  44. end
  45.  
  46. module rec A_FT : sig
  47. (*Call the following comment A_FT-1*)
  48.  
  49. (*           val a : int -> int *)
  50.  
  51. (*And the following comment A_FT-2 *)
  52.            module B : functor (X : sig end) -> sig
  53.                val c : int -> int
  54.              end
  55.          end
  56.   = struct
  57. (*Call the following comment A_FT-1*)
  58. (*    let a x = x + (A_FT.a x)*)
  59.  
  60. (*And the following comment A_FT-2 *)
  61.     module B (X : sig end)= struct
  62.         let c _ = 0
  63.       end
  64.  
  65. end
  66.  
  67.  
  68. (** Comment out below this line, and everything compiles **)
  69.  
  70. module rec A_TT : sig
  71. (*Call the following comment A_TT-1*)
  72.  
  73.            val a : int -> int
  74.  
  75. (*And the following comment A_TT-2 *)
  76.            module B : functor (X : sig end) -> sig
  77.                val c : int -> int
  78.              end
  79.          end
  80.   = struct
  81. (*Call the following comment A_TT-1*)
  82.     let a x = x + (A_TT.a x)
  83.  
  84. (*And the following comment A_TT-2 *)
  85.     module B (X : sig end) = struct
  86.         let c _ = 0
  87.       end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement