2710Re: "ocaml_beginners":: types of local bounded values
- Oct 1, 2004On Fri, 1 Oct 2004 00:56:27 -0700, Issac Trotts <ijtrotts@...> wrote:
>It's made for been read by inteligent editor. The ocaml mode is able to do it.
> On Oct 1, 2004, at 12:38 AM, Radu Grigore wrote:
> > When I read a program written by someone else I find that seeing the
> > inferred types helps. So I use "ocamlc -i". But this does not show
> > the types of locally bound values. Example:
> > let fact n =
> > let rec tail_fact m = function
> > | 1 -> m
> > | n -> tail_fact (m*n) (n-1) in
> > fact 1 n;;
> > The "ocamlc -i" command will show
> > fact : int -> int
> > but not the type of the local function
> > tail_fact : int -> int -> int
> > Is there a way of seeing the infered types for localy bound values?
> You can use the -dtypes compiler flag, though its output isn't very
> easy to read.
- << Previous post in topic