Oug: Example 4
Code

module type T = sig val f : int -> int end
module F1 = functor (P1:T) -> functor (P2:T) ->
struct
let f x = P1.f (P2.f x)
end;;
module I = struct let f x = x + 1 end;;
module J = struct let f x = x + 1 end;;
module K = struct let f x = x + 1 end;;
module L = struct let f x = x + 1 end;;


module MA1 = F1(I)(J);;
let f1 = MA1.f;;

module MA2 = F1(MA1)(MA1);;
let f2 = MA2.f;;

module MA3 = F1 (F1(I)(J))(F1(K)(L));;
let f3 = MA3.f;;
Oug graph

Graph

Debug graph

Debug graph