Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] view types in ocaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] view types in ocaml?
Ed L Cashin <cashin@cs.uga.edu> writes:

> Hi.  I like ocamlbrowser well enough, but is there a way to view type
> info right from the interactive ocaml prompt?
>
> Here's what I'm thinking of (which won't work, of course).
>
>           Objective Caml version 3.06
>   
>   # #load "unix.cma";;
>   # Unix.LargeFile.lseek;;
>   - : Unix.file_descr -> int64 -> Unix.seek_command -> int64 = <fun>
>   # Unix.LargeFile.stats;;
>   type stats = {
>     st_dev : int;

[...]

>     st_ctime : float;
>   } 

well, there is alway the module redefinition trick :

  # module M = Unix.LargeFile;;
   module M :
     sig
       val lseek : Unix.file_descr -> int64 -> Unix.seek_command -> int64

[...]

    type stats =
      Unix.LargeFile.stats = {
      st_dev : int;

[...]

      st_ctime : float;
    }
    val stat : string -> stats
    val lstat : string -> stats
    val fstat : Unix.file_descr -> stats
  end


of course, for very big module, this is not a solution.

-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners