This is a
patch to the OCaml toplevel so that you can display identifiers in
the toplevel. Most importantly, it is based on partial matching so
you can use it for identifier completion. This code builds on Enhtop:
Enhanced Toplevel so it requires that you apply that patch first.
Alternatively, you can use this prepatched OCaml
which has both patches already done.
For example:
# #tell "List.fo";;
val ( List.for_all2 ) : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool =
val ( List.for_all ) : ('a -> bool) -> 'a list -> bool =
val ( List.fold_right ) : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b =
val ( List.fold_right2 ) :
('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c =
val ( List.fold_left ) : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a =
val ( List.fold_left2 ) :
('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'a =
#
One final note. There is also a "#show" directive which is
similar to "#tell" but only works within stuff defined into
the toplevel by the user. Libraries and such are excluded.
See the original
enhtop for a more complete description.