On Thu, Feb 6, 2014 at 6:17 PM, Mário José Parreira Pereira <mariojppereira@gmail.com> wrote:
Hi all,

Is there any way to get the type of (part of) a program? Something like:
   type_of(M) = sigma
computing the type of program M as sigma so I can pattern match it.

No. However, if you really need this rather than being confused by programming patterns from Java / C# / C++, you should learn about GADTs. http://caml.inria.fr/pub/docs/manual-ocaml-400/manual021.html#toc85 

Cheers.