Loading ...
Sorry, an error occurred while loading the content.

2710Re: "ocaml_beginners"::[] types of local bounded values

Expand Messages
  • Remi Vanicat
    Oct 1, 2004
    • 0 Attachment
      On Fri, 1 Oct 2004 00:56:27 -0700, Issac Trotts <ijtrotts@...> wrote:
      >
      > 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.

      It's made for been read by inteligent editor. The ocaml mode is able to do it.
    • Show all 6 messages in this topic