├── images ├── logo.gif └── logo.png ├── man ├── stdlib │ ├── .DS_Store │ ├── style.css │ ├── index_classes.html │ ├── index_class_types.html │ ├── index_methods.html │ ├── index_attributes.html │ ├── type_MoreLabels.Map.OrderedType.html │ ├── type_MoreLabels.Set.OrderedType.html │ ├── type_MoreLabels.Hashtbl.HashedType.html │ ├── type_Map.OrderedType.html │ ├── type_Set.OrderedType.html │ ├── type_Callback.html │ ├── type_Hashtbl.HashedType.html │ ├── type_Mutex.html │ ├── type_Oo.html │ └── type_Condition.html └── extlib │ ├── index_class_types.html │ ├── index_module_types.html │ ├── index_attributes.html │ ├── type_IO.in_chars.html │ ├── style.css │ ├── type_IO.in_channel.html │ ├── index_classes.html │ ├── type_IO.out_chars.html │ ├── type_IO.out_channel.html │ ├── ExtHashtbl.html │ ├── IO.in_channel.html │ ├── ExtString.html │ ├── IO.in_chars.html │ ├── IO.out_chars.html │ ├── ExtArray.html │ ├── IO.out_channel.html │ ├── ExtList.html │ ├── type_RefList.Index.html │ ├── index_methods.html │ ├── type_Unzip.html │ ├── OptParse.html │ ├── type_UTF8.Buf.html │ ├── type_Base64.html │ ├── type_Global.html │ ├── type_Option.html │ ├── IO.BigEndian.html │ ├── type_UChar.html │ ├── UTF8.Buf.html │ ├── type_IO.BigEndian.html │ ├── RefList.Index.html │ ├── type_Std.html │ ├── Unzip.html │ ├── index.html │ └── Global.html ├── opam ├── template │ ├── opam │ └── descr └── ocaml-hoogle.1.0.0 │ ├── descr │ └── opam ├── chconfig.mli ├── .gitignore ├── controller.mli ├── _oasis ├── search.mli ├── configTest.ml ├── scrape-modules.sh ├── modules-init.sh ├── README.mkdn ├── list2.ml ├── chconfig.ml ├── searchTest.ml ├── OMakeroot ├── templates ├── available.html ├── index.html └── search.html ├── base.mli ├── searchid.mli ├── css └── style.css ├── main.ml ├── controller.ml ├── cli.ml ├── base.ml └── hList.ml /images/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mzp/ocaml-hoogle/HEAD/images/logo.gif -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mzp/ocaml-hoogle/HEAD/images/logo.png -------------------------------------------------------------------------------- /man/stdlib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mzp/ocaml-hoogle/HEAD/man/stdlib/.DS_Store -------------------------------------------------------------------------------- /opam/template/opam: -------------------------------------------------------------------------------- 1 | depends: [ "ocamlfind" "omake" "ounit" "CamlGI" "extlib"] 2 | ocaml-version: [= "4.00.1"] 3 | -------------------------------------------------------------------------------- /chconfig.mli: -------------------------------------------------------------------------------- 1 | type t = { 2 | name : string; 3 | path:string option; 4 | modules : string list 5 | } 6 | 7 | val read : string -> t list 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .omakedb 3 | .omakedb.lock 4 | *.cm* 5 | *.omc 6 | *.cgi 7 | *.run 8 | *.opt 9 | *.annot 10 | *.o 11 | *-runner 12 | config-test.txt 13 | modules.txt 14 | 15 | -------------------------------------------------------------------------------- /opam/template/descr: -------------------------------------------------------------------------------- 1 | OCaml API Search 2 | OCaml API search allows you to search many standard O'Caml libraries 3 | by either function name, or by approximate type signature. It is based 4 | on O'Caml Browser. 5 | 6 | It is similar to Hoogle, which is a Haskell API search engine. 7 | -------------------------------------------------------------------------------- /opam/ocaml-hoogle.1.0.0/descr: -------------------------------------------------------------------------------- 1 | OCaml API Search 2 | OCaml API search allows you to search many standard O'Caml libraries 3 | by either function name, or by approximate type signature. It is based 4 | on O'Caml Browser. 5 | 6 | It is similar to Hoogle, which is a Haskell API search engine. 7 | -------------------------------------------------------------------------------- /controller.mli: -------------------------------------------------------------------------------- 1 | type t = 2 | String of string 3 | | Bool of bool 4 | | Table of (string * t) list list 5 | 6 | val format : Chconfig.t list -> Search.t -> (string * t) list 7 | (** formatter for [Search.t] *) 8 | 9 | val pagenation : offset:int -> window:int -> 'a list -> (string * t) list * 'a list 10 | val available : Chconfig.t list -> t 11 | -------------------------------------------------------------------------------- /opam/ocaml-hoogle.1.0.0/opam: -------------------------------------------------------------------------------- 1 | opam-version: "1" 2 | maintainer: "jun.furuse@gmail.com" 3 | build: [ 4 | ["ocaml" "setup.ml" "-configure" "--prefix" "%{prefix}%"] 5 | ["ocaml" "setup.ml" "-build"] 6 | ["ocaml" "setup.ml" "-install"] 7 | ] 8 | remove: [ 9 | ["ocaml" "setup.ml" "-uninstall"] 10 | ] 11 | depends: [ "ocamlfind" "omake" "ounit" "CamlGI" "extlib"] 12 | ocaml-version: [= "4.00.1"] 13 | -------------------------------------------------------------------------------- /_oasis: -------------------------------------------------------------------------------- 1 | OASISFormat: 0.2 2 | Name: ocaml-hoogle 3 | Version: 1.0.0 4 | Synopsis: OCaml API Search 5 | Authors: MIZUNO Hiroki 6 | License: LGPL 7 | Plugins: StdFiles (0.2) 8 | BuildType: Custom (0.2) 9 | InstallType: Custom (0.2) 10 | XCustomBuild: yes no | omake --install; PREFIX=$prefix omake 11 | XCustomInstall: PREFIX=$prefix omake install 12 | XCustomUninstall: PREFIX=$prefix omake uninstall 13 | XCustomBuildClean: PREFIX=$prefix omake clean 14 | BuildTools: omake 15 | -------------------------------------------------------------------------------- /search.mli: -------------------------------------------------------------------------------- 1 | type kind = 2 | Value of string (** type of the value *) 3 | | Type of string (** type def. "" means abstract. *) 4 | | Module 5 | | ModuleType 6 | | Class 7 | | ClassType 8 | | Other 9 | 10 | type t = { 11 | id : string list; (** path of the object. ex. ["String"; "length"] for String.length. *) 12 | kind : kind 13 | } 14 | 15 | val search : string -> string list -> string list -> t list 16 | val raw_search : string -> string list -> string list -> (Longident.t * Searchid.pkind) list 17 | -------------------------------------------------------------------------------- /configTest.ml: -------------------------------------------------------------------------------- 1 | open Base 2 | open OUnit 3 | open Chconfig 4 | 5 | let _ = 6 | open_out_with "config-test.txt" begin fun ch -> 7 | output_string ch "- some package\n"; 8 | output_string ch "PATH:: /path/to/some\n"; 9 | output_string ch "A\n"; 10 | output_string ch "B\n"; 11 | output_string ch "\n"; 12 | output_string ch "- other package\n"; 13 | output_string ch "C\n" 14 | end 15 | 16 | let _ = begin "config.ml" >::: [ 17 | "read" >:: begin fun () -> 18 | assert_equal ~printer:Std.dump [ 19 | { name = "some package"; modules = ["A"; "B"]; path=Some "/path/to/some"}; 20 | { name = "other package"; modules = ["C"]; path=None}; 21 | ] @@ 22 | Chconfig.read "config-test.txt" 23 | end; 24 | ] end +> run_test_tt_main 25 | 26 | -------------------------------------------------------------------------------- /scrape-modules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | stdlib=`ocamlfind query unix` 4 | stdlib_packs="" 5 | 6 | # Package names without '.' 7 | for l in `ocamlfind list | sed -e 's/ .*//' | grep -v '\.'` 8 | do 9 | dir=`ocamlfind query $l` 10 | if [ "$stdlib" = "$dir" ]; then 11 | stdlib_packs="$stdlib_packs $l" 12 | else # skip if dir is as same as stdlib 13 | echo "- $l" 14 | echo "PATH:: $dir" 15 | ls $dir/*.cmi 2> /dev/null | sed -e 's/.*\///g' -e 's/\.cmi//' -e 's/^./\u&/' 16 | fi 17 | done 18 | 19 | echo "- stdlib" 20 | echo "# Thread realted modules are found in the next PATH spec. The others are found in the default one." 21 | echo "PATH:: $stdlib/threads" 22 | ls $stdlib/*.cmi | sed -e 's/.*\///g' -e 's/\.cmi//' -e 's/^./\u&/' 23 | for p in $stdlib_packs 24 | do 25 | if [ -d "$stdlib/$p" ]; then 26 | ls $stdlib/$p/*.cmi | sed -e 's/.*\///g' -e 's/\.cmi//' -e 's/^./\u&/' 27 | fi 28 | done 29 | -------------------------------------------------------------------------------- /modules-init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cat < modules.txt 4 | - stdlib 5 | # Thread realted modules are found in the next PATH spec. The others are found in the default one. 6 | PATH:: `ocamlfind query threads.posix` 7 | Pervasives 8 | Arg 9 | Array 10 | ArrayLabels 11 | Buffer 12 | Callback 13 | Char 14 | Complex 15 | Digest 16 | Filename 17 | Format 18 | Gc 19 | Genlex 20 | Hashtbl 21 | Int32 22 | Int64 23 | Lazy 24 | Lexing 25 | List 26 | ListLabels 27 | Map 28 | Marshal 29 | MoreLabels 30 | Nativeint 31 | Oo 32 | Parsing 33 | Printexc 34 | Printf 35 | Queue 36 | Random 37 | Scanf 38 | Set 39 | Sort 40 | Stack 41 | StdLabels 42 | Stream 43 | String 44 | StringLabels 45 | Sys 46 | Weak 47 | Unix 48 | UnixLabels 49 | Num 50 | Big_int 51 | Arith_status 52 | Str 53 | Thread 54 | Mutex 55 | Condition 56 | Event 57 | ThreadUnix 58 | - extlib 59 | PATH:: `ocamlfind query extlib` 60 | IO 61 | Base64 62 | BitSet 63 | Dllist 64 | DynArray 65 | Enum 66 | ExtArray 67 | ExtHashtbl 68 | ExtList 69 | ExtString 70 | Global 71 | OptParse 72 | Option 73 | PMap 74 | RefList 75 | Std 76 | UChar 77 | UTF8 78 | Unzip 79 | EOF 80 | -------------------------------------------------------------------------------- /README.mkdn: -------------------------------------------------------------------------------- 1 | OCaml API Search 2 | =========================================== 3 | 4 | OVERVIEW 5 | -------- 6 | 7 | OCaml API search allows you to search many standard O'Caml libraries 8 | by either function name, or by approximate type signature. It is based 9 | on OCaml Browser. 10 | 11 | It is similar to Hoogle, which is a Haskell API search engine. 12 | 13 | PREREQUISITES 14 | ------------- 15 | 16 | * ocaml 4.00.1 17 | * omake 18 | * findlib 19 | * extlib 20 | * oUnit(for unit test) 21 | * CamlGI 22 | 23 | INSTALL 24 | ------- 25 | 26 | ### 1. Download OCaml API search ### 27 | 28 | * git clone git://github.com/mzp/ocaml-hoogle.git 29 | 30 | ### 2. Build OCaml API Search ### 31 | 32 | * cd ocaml-hoogle 33 | * omake 34 | 35 | ### 3. How to use ### 36 | 37 | * run index.cgi as CGI 38 | * use `ocamlas` from termianl 39 | 40 | 41 | LICENCE 42 | ------- 43 | searchid.ml and list2.ml is written by Jacques Garrigue. The licence is LGPL 44 | 45 | Other codes is written by MIZUNO Hiroki., The licence is LGPL. 46 | 47 | AUTHOR 48 | ------ 49 | MIZUNO "mzp" Hiroki (mzp@ocaml.jp) 50 | 51 | AVAILABILITY 52 | ------------ 53 | The complete OCaml API search distribution can be accessed at this[http://github.com/mzp/ocaml-hoogle]. 54 | -------------------------------------------------------------------------------- /list2.ml: -------------------------------------------------------------------------------- 1 | (*************************************************************************) 2 | (* *) 3 | (* OCaml LablTk library *) 4 | (* *) 5 | (* Jacques Garrigue, Kyoto University RIMS *) 6 | (* *) 7 | (* Copyright 1999 Institut National de Recherche en Informatique et *) 8 | (* en Automatique and Kyoto University. All rights reserved. *) 9 | (* This file is distributed under the terms of the GNU Library *) 10 | (* General Public License, with the special exception on linking *) 11 | (* described in file ../../../LICENSE. *) 12 | (* *) 13 | (*************************************************************************) 14 | 15 | (* $Id: list2.ml 11156 2011-07-27 14:17:02Z doligez $ *) 16 | 17 | open StdLabels 18 | 19 | let exclude x l = List.filter l ~f:((<>) x) 20 | 21 | let rec flat_map ~f = function 22 | [] -> [] 23 | | x :: l -> f x @ flat_map ~f l 24 | -------------------------------------------------------------------------------- /chconfig.ml: -------------------------------------------------------------------------------- 1 | open Base 2 | open Str 3 | type t = { 4 | name : string; 5 | path : string option; 6 | modules : string list 7 | } 8 | 9 | let name = ref "" 10 | let path = ref None 11 | let modules = ref [] 12 | let configs = ref [] 13 | 14 | let chop s = 15 | let r = 16 | regexp "[\r\n]" 17 | in 18 | global_replace r "" s 19 | 20 | let add_current () = 21 | if !name <> "" then 22 | configs := { name = !name; modules = List.rev !modules; path= !path } :: 23 | !configs; 24 | name := ""; 25 | path := None; 26 | modules := [] 27 | 28 | let r_package = 29 | regexp "^- *\\(.*\\)$" 30 | 31 | let r_path = 32 | regexp "^PATH *:: *\\(.*\\)$" 33 | 34 | let parse_line s = 35 | if s = "" || s.[0] = '#' then 36 | () 37 | else if string_match r_path s 0 then 38 | path := Some (matched_group 1 s) 39 | else if string_match r_package s 0 then begin 40 | add_current (); 41 | name := matched_group 1 s 42 | end else 43 | modules := s :: !modules 44 | 45 | let read path = 46 | configs := []; 47 | name := ""; 48 | try 49 | open_in_with path begin fun ch -> 50 | while true do 51 | parse_line @@ chop @@ input_line ch 52 | done; 53 | end; 54 | failwith "must not happen" 55 | with End_of_file -> 56 | add_current (); 57 | List.rev !configs 58 | 59 | -------------------------------------------------------------------------------- /searchTest.ml: -------------------------------------------------------------------------------- 1 | open Base 2 | open OUnit 3 | open Search 4 | 5 | let ok x y = assert_equal ~printer:Std.dump x y 6 | 7 | let path = 8 | input_line @@ Unix.open_process_in "ocamlfind query extlib" 9 | 10 | let _ = begin "search.ml" >::: [ 11 | "empty" >:: begin fun () -> 12 | ok [] @@ search "" [] [] 13 | end; 14 | "value" >:: begin fun () -> 15 | ok [{id = ["String";"concat"]; 16 | kind = Value "string -> string list -> string"}] @@ 17 | search "concat" ["String"] [] 18 | end; 19 | "nest module" >:: begin fun () -> 20 | ok [{id=["StdLabels";"String";"concat"]; 21 | kind = Value "sep:string -> string list -> string"}] @@ 22 | search "string list -> string" ["StdLabels"] [] 23 | end; 24 | "type" >:: begin fun () -> 25 | ok {id=["String"; "t"]; kind = Type "string"} @@ 26 | List.nth (search "t" ["String"] []) 0 27 | end; 28 | (* CR jfuruse: We fail here 29 | "module" >:: begin fun () -> 30 | ok [{id=["String"]; kind = Module}] @@ 31 | search "String" ["String"] [] 32 | end; *) 33 | "module sig" >:: begin fun () -> 34 | ok [{id=["Set";"S"]; kind = ModuleType}] @@ 35 | search "S" ["Set"] [] 36 | end; 37 | "external" >:: begin fun () -> 38 | ok [{id=["Std";"dump"]; 39 | kind = Value "'a -> string"}] @@ 40 | search "dump" ["Std"] [path] 41 | end; 42 | ] end +> run_test_tt_main 43 | -------------------------------------------------------------------------------- /OMakeroot: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # Permission is hereby granted, free of charge, to any person 3 | # obtaining a copy of this file, to deal in the File without 4 | # restriction, including without limitation the rights to use, 5 | # copy, modify, merge, publish, distribute, sublicense, and/or 6 | # sell copies of the File, and to permit persons to whom the 7 | # File is furnished to do so, subject to the following condition: 8 | # 9 | # THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 10 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 11 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 12 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 13 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR 15 | # THE USE OR OTHER DEALINGS IN THE FILE. 16 | 17 | ######################################################################## 18 | # The standard OMakeroot file. 19 | # You will not normally need to modify this file. 20 | # By default, your changes should be placed in the 21 | # OMakefile in this directory. 22 | # 23 | # If you decide to modify this file, note that it uses exactly 24 | # the same syntax as the OMakefile. 25 | # 26 | 27 | # 28 | # Include the standard installed configuration files. 29 | # Any of these can be deleted if you are not using them, 30 | # but you probably want to keep the Common file. 31 | # 32 | open build/C 33 | open build/OCaml 34 | open build/LaTeX 35 | 36 | # 37 | # The command-line variables are defined *after* the 38 | # standard configuration has been loaded. 39 | # 40 | DefineCommandVars() 41 | 42 | # 43 | # Include the OMakefile in this directory. 44 | # 45 | .SUBDIRS: . 46 | -------------------------------------------------------------------------------- /templates/available.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Available modules - OCaml API search 12 | 13 | 14 |

OCaml API search

15 |

Available modules

16 | ::table(available):: 17 |

::package_html::

18 | 23 | ::end:: 24 | 27 | 28 | 35 | 38 | 39 |
MIZUNO Hiroki © 2010
40 | 44 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /man/extlib/index_class_types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Index of class types 31 | 32 | 33 |

Index of class types

34 | 35 |

36 | 37 | -------------------------------------------------------------------------------- /man/extlib/index_module_types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Index of module types 31 | 32 | 33 |

Index of module types

34 | 35 |

36 | 37 | -------------------------------------------------------------------------------- /man/extlib/index_attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Index of class attributes 31 | 32 | 33 |

Index of class attributes

34 | 35 |

36 | 37 | -------------------------------------------------------------------------------- /base.mli: -------------------------------------------------------------------------------- 1 | external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply" 2 | (** Haskell's ($) *) 3 | 4 | external ( +> ) : 'a -> ('a -> 'b) -> 'b = "%revapply" 5 | (** F#'s (|>) *) 6 | 7 | val ( $ ) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b 8 | (** Haskell's (.) *) 9 | 10 | val ( !$ ) : 'a Lazy.t -> 'a 11 | (** Lazy.force *) 12 | 13 | external id : 'a -> 'a = "%identity" 14 | (** Identity *) 15 | 16 | val uncurry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c 17 | val curry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c 18 | val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c 19 | val const : 'a -> 'b -> 'a 20 | val sure : ('a -> 'b) -> 'a option -> 'b option 21 | val option : ('a -> 'b) -> 'a -> 'b option 22 | val maybe : ('a -> 'b) -> 'a -> [> `Error of exn | `Val of 'b ] 23 | val tee : ('a -> 'b) -> 'a -> 'a 24 | type ('a, 'b) either = Left of 'a | Right of 'b 25 | 26 | val failwithf : ('a, unit, string, unit -> 'b) format4 -> 'a 27 | (** failwith with formatting *) 28 | 29 | val assoc : 'a -> ('a * 'b) list -> 'b option 30 | (** List.assoc with option *) 31 | 32 | val string_of_list : string list -> string 33 | val unfold : ('a -> ('b * 'a) option) -> 'a -> 'b list 34 | val range : int -> int -> int list 35 | val interperse : 'a -> 'a list -> 'a list 36 | val map_accum_left : ('a -> 'b -> 'a * 'c) -> 'a -> 'b list -> 'a * 'c list 37 | val map_accum_right : ('a -> 'b -> 'a * 'c) -> 'a -> 'b list -> 'a * 'c list 38 | val filter_map : ('a -> 'b option) -> 'a list -> 'b list 39 | val group_by : ('a -> 'a -> bool) -> 'a list -> 'a list list 40 | val index : 'a -> 'a list -> int 41 | val string_of_char : char -> string 42 | val hex : int -> string 43 | val open_out_with : string -> (out_channel -> 'a) -> 'a 44 | val open_in_with : string -> (in_channel -> 'a) -> 'a 45 | val undefined : 'a 46 | val undef : 'a 47 | 48 | val format_list : 49 | (unit, Format.formatter, unit) format 50 | -> (Format.formatter -> 'a -> unit) 51 | -> Format.formatter -> 'a list -> unit 52 | (** Format for lists *) 53 | 54 | val format_ocaml_list : 55 | (Format.formatter -> 'a -> unit) 56 | -> Format.formatter -> 'a list -> unit 57 | (** Format for lists in OCaml style [ a; b; ... ] *) 58 | -------------------------------------------------------------------------------- /man/extlib/type_IO.in_chars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | IO.in_chars 30 | 31 | 32 | IO.input ->
33 | object method close_in : unit -> unit method get : unit -> char end
-------------------------------------------------------------------------------- /man/extlib/style.css: -------------------------------------------------------------------------------- 1 | a:visited {color : #416DFF; text-decoration : none; } 2 | a:link {color : #416DFF; text-decoration : none;} 3 | a:hover {color : Red; text-decoration : none; background-color: #5FFF88} 4 | a:active {color : Red; text-decoration : underline; } 5 | .keyword { font-weight : bold ; color : Red } 6 | .keywordsign { color : #C04600 } 7 | .superscript { font-size : 4 } 8 | .subscript { font-size : 4 } 9 | .comment { color : Green } 10 | .constructor { color : Blue } 11 | .type { color : #5C6585 } 12 | .string { color : Maroon } 13 | .warning { color : Red ; font-weight : bold } 14 | .info { margin-left : 3em; margin-right : 3em } 15 | .code { color : #465F91 ; } 16 | h1 { font-size : 20pt ; text-align: center; } 17 | h2 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90BDFF ;padding: 2px; } 18 | h3 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90DDFF ;padding: 2px; } 19 | h4 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90EDFF ;padding: 2px; } 20 | h5 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90FDFF ;padding: 2px; } 21 | h6 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90BDFF ; padding: 2px; } 22 | div.h7 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90DDFF ; padding: 2px; } 23 | div.h8 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #F0FFFF ; padding: 2px; } 24 | div.h9 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #FFFFFF ; padding: 2px; } 25 | .typetable { border-style : hidden } 26 | .indextable { border-style : hidden } 27 | .paramstable { border-style : hidden ; padding: 5pt 5pt} 28 | body { background-color : White } 29 | tr { background-color : White } 30 | td.typefieldcomment { background-color : #FFFFFF } 31 | pre { margin-bottom: 4px } 32 | div.sig_block {margin-left: 2em} -------------------------------------------------------------------------------- /man/stdlib/style.css: -------------------------------------------------------------------------------- 1 | a:visited {color : #416DFF; text-decoration : none; } 2 | a:link {color : #416DFF; text-decoration : none;} 3 | a:hover {color : Red; text-decoration : none; background-color: #5FFF88} 4 | a:active {color : Red; text-decoration : underline; } 5 | .keyword { font-weight : bold ; color : Red } 6 | .keywordsign { color : #C04600 } 7 | .superscript { font-size : 4 } 8 | .subscript { font-size : 4 } 9 | .comment { color : Green } 10 | .constructor { color : Blue } 11 | .type { color : #5C6585 } 12 | .string { color : Maroon } 13 | .warning { color : Red ; font-weight : bold } 14 | .info { margin-left : 3em; margin-right : 3em } 15 | .code { color : #465F91 ; } 16 | h1 { font-size : 20pt ; text-align: center; } 17 | h2 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90BDFF ;padding: 2px; } 18 | h3 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90DDFF ;padding: 2px; } 19 | h4 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90EDFF ;padding: 2px; } 20 | h5 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90FDFF ;padding: 2px; } 21 | h6 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90BDFF ; padding: 2px; } 22 | div.h7 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90DDFF ; padding: 2px; } 23 | div.h8 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #F0FFFF ; padding: 2px; } 24 | div.h9 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #FFFFFF ; padding: 2px; } 25 | .typetable { border-style : hidden } 26 | .indextable { border-style : hidden } 27 | .paramstable { border-style : hidden ; padding: 5pt 5pt} 28 | body { background-color : White } 29 | tr { background-color : White } 30 | td.typefieldcomment { background-color : #FFFFFF } 31 | pre { margin-bottom: 4px } 32 | div.sig_block {margin-left: 2em} -------------------------------------------------------------------------------- /searchid.mli: -------------------------------------------------------------------------------- 1 | (*************************************************************************) 2 | (* *) 3 | (* Objective Caml LablTk library *) 4 | (* *) 5 | (* Jacques Garrigue, Kyoto University RIMS *) 6 | (* *) 7 | (* Copyright 1999 Institut National de Recherche en Informatique et *) 8 | (* en Automatique and Kyoto University. All rights reserved. *) 9 | (* This file is distributed under the terms of the GNU Library *) 10 | (* General Public License, with the special exception on linking *) 11 | (* described in file ../../../LICENSE. *) 12 | (* *) 13 | (*************************************************************************) 14 | 15 | (* $Id: searchid.mli,v 1.6 2002/07/25 22:51:47 garrigue Exp $ *) 16 | 17 | module Stat : sig 18 | (** search statistics *) 19 | type t = { 20 | type_included : int; 21 | type_exact : int; 22 | symbol : int; 23 | time : float; 24 | } 25 | val format : Format.formatter -> t -> unit 26 | val get : ('a -> 'b) -> 'a -> [> `Error of exn | `Ok of 'b ] * t 27 | end 28 | 29 | val start_env : Env.t ref 30 | val module_list : string list ref 31 | val longident_of_path : Path.t ->Longident.t 32 | 33 | type pkind = 34 | Pvalue 35 | | Ptype 36 | | Plabel 37 | | Pconstructor 38 | | Pmodule 39 | | Pmodtype 40 | | Pclass 41 | | Pcltype 42 | 43 | val string_of_kind : pkind -> string 44 | 45 | exception Error of int * int 46 | 47 | val search_string_type : 48 | string -> mode:[`Exact|`Included] -> (Longident.t * pkind) list 49 | val search_pattern_symbol : string -> (Longident.t * pkind) list 50 | val search_string_symbol : string -> (Longident.t * pkind) list 51 | 52 | val search_structure : 53 | Parsetree.structure -> 54 | name:string -> kind:pkind -> prefix:string list -> int 55 | val search_signature : 56 | Parsetree.signature -> 57 | name:string -> kind:pkind -> prefix:string list -> int 58 | -------------------------------------------------------------------------------- /man/extlib/type_IO.in_channel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | IO.in_channel 30 | 31 | 32 | IO.input ->
33 | object
34 |   method close_in : unit -> unit
35 |   method input : string -> int -> int -> int
36 | end
-------------------------------------------------------------------------------- /man/extlib/index_classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Index of classes 31 | 32 | 33 |

Index of classes

34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |

I
in_channel [IO]
in_chars [IO]

O
out_channel [IO]
out_chars [IO]

46 | 47 | -------------------------------------------------------------------------------- /man/extlib/type_IO.out_chars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | IO.out_chars 30 | 31 | 32 | 'IO.output ->
33 | object
34 |   method close_out : unit -> unit
35 |   method flush : unit -> unit
36 |   method put : char -> unit
37 | end
-------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | h1,h2,h3,ul,ol,li,p,html,body,address{ 2 | margin:0; 3 | border:0; 4 | padding:0; 5 | } 6 | 7 | a img { 8 | border:none; 9 | } 10 | 11 | h1 { 12 | text-align: center; 13 | } 14 | 15 | form { 16 | text-align: center; 17 | } 18 | 19 | body { 20 | padding-top:20px; 21 | padding-bottom:20px; 22 | width: 800px; 23 | margin: 0 auto; 24 | font-size:16px; 25 | } 26 | 27 | ul.examples { 28 | border:2px solid #CCCC55; 29 | padding:10px; 30 | background-color: #FFFF88; 31 | } 32 | 33 | h2{ 34 | margin-top: 30px; 35 | margin-bottom: 10px; 36 | } 37 | 38 | p,li { 39 | margin: 5px 0; 40 | } 41 | 42 | li { 43 | list-style-type: none; 44 | } 45 | 46 | address{ 47 | margin-top: 30px; 48 | text-align: center; 49 | font-size: 14px; 50 | } 51 | 52 | .search h1, .search form{ 53 | display: inline-block; 54 | } 55 | 56 | .search h1 img{ 57 | height:42px; 58 | vertical-align: bottom; 59 | } 60 | 61 | .search form { 62 | margin-left:10px; 63 | } 64 | 65 | table { 66 | width:800px; 67 | font-size: 14px; 68 | margin: 20px 0; 69 | } 70 | 71 | td { 72 | vertical-align: top; 73 | padding-bottom: 5px; 74 | } 75 | 76 | td.where{ 77 | text-align:right; 78 | padding-right:5px; 79 | width:150px; 80 | } 81 | 82 | td.entry{ 83 | width:650px; 84 | } 85 | 86 | .where .module * { 87 | color:#008C00; 88 | } 89 | 90 | .package * { 91 | font-size:12px; 92 | color:#4096EE; 93 | } 94 | 95 | p.target { 96 | border-top: 1px solid #4096EE; 97 | background-color: #C3D9FF; 98 | padding: 5px; 99 | font-size:14px; 100 | } 101 | 102 | div.navigation { 103 | font-size:14px; 104 | margin-bottom:30px; 105 | } 106 | 107 | div.navigation div { 108 | display:inline-block; 109 | } 110 | 111 | div.navigation a { 112 | text-decoration: none; 113 | } 114 | 115 | ul.jump { 116 | display:inline-block; 117 | } 118 | 119 | ul.jump li { 120 | display: inline-block; 121 | width: 25px; 122 | text-align: center; 123 | border:1px solid #808080; 124 | padding-top:3px; 125 | padding-bottom:3px; 126 | } 127 | 128 | ul.jump li.current, ul.jump li:hover { 129 | border-color: #4096EE; 130 | background-color: #C3D9FF; 131 | } 132 | 133 | em { 134 | font-weight: bold; 135 | font-style: normal; 136 | } 137 | 138 | iframe { 139 | border: 1px solid black; 140 | } 141 | 142 | ul.available-modules li { 143 | display: inline; 144 | } -------------------------------------------------------------------------------- /man/extlib/type_IO.out_channel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | IO.out_channel 30 | 31 | 32 | 'IO.output ->
33 | object
34 |   method close_out : unit -> unit
35 |   method flush : unit -> unit
36 |   method output : string -> int -> int -> int
37 | end
-------------------------------------------------------------------------------- /main.ml: -------------------------------------------------------------------------------- 1 | open Base 2 | open StdLabels 3 | open CamlGI 4 | open CamlGI.Cgi 5 | open CamlGI.Template 6 | 7 | open Search 8 | 9 | let rec to_var = function 10 | Controller.String s -> 11 | Template.VarString s 12 | | Controller.Bool b -> 13 | Template.VarConditional b 14 | | Controller.Table rows -> 15 | Template.VarTable begin 16 | List.map rows ~f:begin fun row -> 17 | List.map row ~f:begin fun (name, cell) -> 18 | (name, to_var cell) 19 | end 20 | end 21 | end 22 | 23 | let set t (name,var) = 24 | match var with 25 | Controller.String s -> 26 | t#set name s 27 | | Controller.Bool b -> 28 | t#conditional name b 29 | | Controller.Table rows -> 30 | t#table name begin 31 | List.map rows ~f:begin 32 | List.map ~f:begin fun (name,var) -> 33 | (name,to_var var) 34 | end 35 | end 36 | end 37 | 38 | let safe_int_of_string s = 39 | try 40 | int_of_string s 41 | with _ -> 42 | 0 43 | 44 | let index_page (cgi : cgi) = 45 | cgi#template @@ template "templates/index.html" 46 | 47 | let configs () = 48 | Chconfig.read "modules.txt" 49 | 50 | let available_page (cgi : cgi) = 51 | let t = 52 | template "templates/available.html" 53 | in 54 | set t ("available", (Controller.available @@ configs ())); 55 | cgi#template t 56 | 57 | let search_page (cgi : cgi) = 58 | let configs = 59 | configs () 60 | in 61 | let modules = 62 | HList.concat_map (fun {Chconfig.modules=m} -> m) configs 63 | in 64 | let paths = 65 | filter_map (fun {Chconfig.path=p} -> p) configs 66 | in 67 | let page, content = 68 | Search.search (cgi#param "q") modules paths 69 | +> Controller.pagenation ~window:20 ~offset:(try 70 | int_of_string @@ cgi#param "o" 71 | with _ -> 0) 72 | in 73 | let result = 74 | content 75 | +> List.map ~f:(List.map ~f:(fun (name,v) -> (name,to_var v)) 76 | $ Controller.format configs) 77 | in 78 | let t = 79 | template "templates/search.html" 80 | in 81 | List.iter page ~f:(set t); 82 | t#set "query" @@ cgi#param "q"; 83 | t#conditional "found" @@ (result <> []); 84 | t#table "result" result; 85 | cgi#template t 86 | 87 | let _ = 88 | register_script begin fun req -> 89 | let q = 90 | new cgi req 91 | in 92 | q#header ~content_type:"text/html; charset=utf-8" (); 93 | if q#param_exists "q" then 94 | search_page q 95 | else if q#param_exists "available" then 96 | available_page q 97 | else 98 | index_page q 99 | end 100 | -------------------------------------------------------------------------------- /man/extlib/ExtHashtbl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ExtHashtbl 35 | 36 | 37 | 41 |

Module ExtHashtbl

42 |
43 |
module ExtHashtbl: sig .. end
Extra functions over hashtables.
44 |
45 |
module Hashtbl: sig .. end
-------------------------------------------------------------------------------- /man/extlib/IO.in_channel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | IO.in_channel 34 | 35 | 36 | 39 |

Class IO.in_channel

40 |
41 |
class in_channel : input -> object .. end

42 |
method input : string -> int -> int -> int
method close_in : unit -> unit
-------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | OCaml API search 12 | 13 | 14 |

OCaml API search

15 |
16 |

17 |
18 | 19 |

Welcome to OCaml API search

20 |

21 | OCaml API search allows you to search 22 | many standard O'Caml libraries by either function name, or by 23 | approximate type signature. It is based on O'Caml Browser. 24 |

25 |

26 | It is similar 27 | to Hoogle, which is a 28 | Haskell API search engine. 29 |

30 |

Example searches

31 | 36 |

Enter your own search at the top of the page.

37 | 38 |

Feedbacks

39 |

40 | Please fork me on GitHub, 41 | or send message via Twitter / 42 | mail. 43 |

44 | 45 | 52 | 55 | 56 |
MIZUNO Hiroki © 2010
57 | 61 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /man/extlib/ExtString.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ExtString 35 | 36 | 37 | 41 |

Module ExtString

42 |
43 |
module ExtString: sig .. end
Additional functions for string manipulations.
44 |
45 |
exception Invalid_string
46 |
module String: sig .. end
-------------------------------------------------------------------------------- /man/extlib/IO.in_chars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | IO.in_chars 35 | 36 | 37 | 41 |

Class IO.in_chars

42 |
43 |
class in_chars : input -> object .. end

44 |
method get : unit -> char
method close_in : unit -> unit
-------------------------------------------------------------------------------- /man/extlib/IO.out_chars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | IO.out_chars 34 | 35 | 36 | 39 |

Class IO.out_chars

40 |
41 |
class out_chars : 'a output -> object .. end

42 |
method put : char -> unit
method flush : unit -> unit
method close_out : unit -> unit
-------------------------------------------------------------------------------- /man/extlib/ExtArray.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ExtArray 35 | 36 | 37 | 41 |

Module ExtArray

42 |
43 |
module ExtArray: sig .. end
Additional and modified functions for arrays. 44 |

45 | 46 | The OCaml standard library provides a module of array functions. 47 | This ExtArray module can be used to override the Array module or 48 | as a standalone module. It provides some additional functions.
49 |


50 |
module Array: sig .. end
-------------------------------------------------------------------------------- /man/extlib/IO.out_channel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | IO.out_channel 35 | 36 | 37 | 41 |

Class IO.out_channel

42 |
43 |
class out_channel : 'a output -> object .. end

44 |
method output : string -> int -> int -> int
method flush : unit -> unit
method close_out : unit -> unit
-------------------------------------------------------------------------------- /controller.ml: -------------------------------------------------------------------------------- 1 | open Base 2 | open StdLabels 3 | 4 | type t = 5 | String of string 6 | | Bool of bool 7 | | Table of (string * t) list list 8 | 9 | let find_package module_ configs = 10 | let config = 11 | List.find configs 12 | ~f:(fun { Chconfig.modules=modules } -> List.mem (List.hd module_) modules) 13 | in 14 | config.Chconfig.name 15 | 16 | let module_ = 17 | function [] -> [""] 18 | | [x] -> [x] 19 | | xs -> HList.init xs 20 | 21 | let format configs {Search.id=id; kind=kind} = 22 | let kind, opt = 23 | match kind with 24 | Search.Value s -> 25 | "value",[ "type", String s] 26 | | Search.Type "" -> 27 | "type",[ "is_abstract", Bool true] 28 | | Search.Type s -> 29 | "type",[ "is_abstract", Bool false; 30 | "type", String s ] 31 | | Search.Module -> 32 | "module",["module_name", String (String.concat ~sep:"." id)] 33 | | Search.ModuleType -> 34 | "module_type",[] 35 | | Search.Class -> 36 | "class",[] 37 | | Search.ClassType -> 38 | "class_type",[] 39 | | _ -> 40 | "", [] 41 | in 42 | ["module" , String (String.concat ~sep:"." @@ module_ id); 43 | "name" , String (HList.last id); 44 | "package", String (find_package id configs)] 45 | @ List.map ["value"; "type"; "module"; "module_type"; "class"; "class_type"] 46 | ~f:(fun x -> ("is_" ^ x, Bool (x = kind))) 47 | @ opt 48 | 49 | let int n = 50 | String (string_of_int n) 51 | 52 | let pagenation ~offset ~window xs = 53 | let window = 54 | max 0 window 55 | in 56 | let count = 57 | List.length xs 58 | in 59 | let from = 60 | max 0 offset 61 | in 62 | let to_ = 63 | min count (offset+window) 64 | in 65 | List.concat [ 66 | ["from" , int @@ from + 1; 67 | "to" , int @@ to_; 68 | "count", int @@ count]; 69 | if to_ < count then 70 | ["is_next", Bool true; 71 | "next_offset", int to_] 72 | else 73 | ["is_next", Bool false]; 74 | if 0 < from then 75 | ["is_prev", Bool true; 76 | "prev_offset", int @@ from - window] 77 | else 78 | ["is_prev", Bool false]; 79 | ["navigation", Table ( 80 | List.map (range 0 (int_of_float @@ ceil @@ (float_of_int count) /. (float_of_int window))) 81 | ~f:begin fun i -> 82 | if i*window <= offset && offset < (i+1)*window then 83 | ["is_current", Bool true; 84 | "number", int @@ i+1] 85 | else 86 | ["is_current", Bool false; 87 | "number", int @@ i+1; 88 | "offset", int @@ i*window] 89 | end 90 | )] 91 | ], HList.take window @@ HList.drop offset xs 92 | 93 | let available configs = 94 | Table begin 95 | List.map configs ~f:begin fun { Chconfig.name = name; modules = modules} -> 96 | ["package", String name; 97 | "modules", Table begin 98 | List.map modules ~f:begin fun s -> 99 | ["name", String s] 100 | end 101 | end ] 102 | end 103 | end 104 | -------------------------------------------------------------------------------- /man/extlib/ExtList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ExtList 35 | 36 | 37 | 41 |

Module ExtList

42 |
43 |
module ExtList: sig .. end
Additional and modified functions for lists. 44 |

45 | 46 | The OCaml standard library provides a module for list functions. 47 | This ExtList module can be used to override the List module or 48 | as a standalone module. It provides new functions and modify 49 | the behavior of some other ones (in particular all functions 50 | are now tail-recursive).
51 |


52 |
module List: sig .. end
val (@) : 'a list -> 'a list -> 'a list
53 | the new implementation for ( @ ) operator, see List.append.
54 |
55 | -------------------------------------------------------------------------------- /cli.ml: -------------------------------------------------------------------------------- 1 | open Base 2 | 3 | let q = 4 | let rev_args = ref [] in 5 | Arg.parse [] (fun x -> rev_args := x::!rev_args) 6 | @@ Printf.sprintf "%s " Sys.argv.(0); 7 | String.concat " " @@ List.rev !rev_args 8 | 9 | let configs = Chconfig.read "modules.txt" 10 | 11 | let modules = HList.concat_map (fun {Chconfig.modules=m} -> m) configs 12 | 13 | let paths = filter_map (fun {Chconfig.path=p} -> p) configs 14 | 15 | let results, stat = 16 | match Searchid.Stat.get (Search.raw_search q modules) paths with 17 | | `Error exn, _ -> raise exn 18 | | `Ok res, stat -> res, stat 19 | 20 | open Format 21 | 22 | let info_of_value id = 23 | let _name = 24 | match id with 25 | | Longident.Lident x -> x 26 | | Longident.Ldot (_, x) -> x 27 | | _ -> "z" 28 | in 29 | let _, vd = 30 | Env.lookup_value id !Searchid.start_env 31 | in 32 | vd.Types.val_type, vd.Types.val_loc 33 | 34 | let info_of_type id = 35 | let _path, td = Env.lookup_type id !Searchid.start_env in 36 | td 37 | 38 | let analyze_pkind (id, pkind) = match pkind with 39 | | Searchid.Pvalue -> 40 | `Value (id, info_of_value id) 41 | | Searchid.Ptype -> 42 | `Type (id, info_of_type id) 43 | | Searchid.Pmodule -> 44 | `Module id 45 | | Searchid.Pmodtype -> 46 | `ModuleType id 47 | | Searchid.Pclass -> 48 | `Class id 49 | | Searchid.Pcltype -> 50 | `ClassType id 51 | | Searchid.Plabel -> 52 | `Label id 53 | | Searchid.Pconstructor -> 54 | `Constr id 55 | 56 | (* module O = Outcometree --- We cannot do this! Since outcometree is mli only... 57 | *) 58 | open Outcometree 59 | open Types 60 | 61 | let format ppf = function 62 | | `Value (id, (type_, _loc)) -> 63 | (* 64 | fprintf ppf "%a@.val %a : %a@." 65 | Location.print_loc loc 66 | Printtyp.longident id 67 | Printtyp.type_scheme type_ 68 | *) 69 | fprintf ppf "@[<2>val %a :@ %a@]" 70 | Printtyp.longident id 71 | Printtyp.type_scheme type_ 72 | | `Type (id, td) -> 73 | (* To print the path name with module names, 74 | we hack outcometree *) 75 | let o = Printtyp.tree_of_type_declaration (Ident.create "z") td Types.Trec_first in 76 | let o = match o with 77 | | Osig_type (odecl, ors) -> 78 | let odecl = match odecl with 79 | | _name, a, b, c, d -> 80 | String.concat "." (Longident.flatten id), a, b, c, d 81 | in 82 | Osig_type (odecl, ors) 83 | | _ -> assert false 84 | in 85 | !Oprint.out_sig_item ppf o; 86 | if td.type_manifest = None && td.type_kind = Type_abstract then 87 | fprintf ppf " (* abstract *)" 88 | | `Module id -> 89 | fprintf ppf "module %a" Printtyp.longident id 90 | | `ModuleType id -> 91 | fprintf ppf "module type %a" Printtyp.longident id 92 | | `Class id -> 93 | fprintf ppf "class %a" Printtyp.longident id 94 | | `ClassType id -> 95 | fprintf ppf "class type %a" Printtyp.longident id 96 | | `Label id -> 97 | fprintf ppf "label %a" Printtyp.longident id 98 | | `Constr id -> 99 | fprintf ppf "constr %a" Printtyp.longident id 100 | 101 | let () = 102 | Format.printf "%a@.%a@." 103 | (format_list "@." format) (List.map analyze_pkind results) 104 | Searchid.Stat.format stat 105 | 106 | -------------------------------------------------------------------------------- /man/extlib/type_RefList.Index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | RefList.Index 30 | 31 | 32 | sig
33 |   val index_of : 'RefList.t -> '-> int
34 |   val index : ('-> bool) -> 'RefList.t -> int
35 |   val at_index : 'RefList.t -> int -> 'a
36 |   val set : 'RefList.t -> int -> '-> unit
37 |   val remove_at : 'RefList.t -> int -> unit
38 | end
-------------------------------------------------------------------------------- /base.ml: -------------------------------------------------------------------------------- 1 | external (@@) : ('a -> 'b) -> 'a -> 'b = "%apply" 2 | external (+>) : 'a -> ('a -> 'b) -> 'b = "%revapply" 3 | let ($) f g x = f (g x) 4 | let (!$) = Lazy.force 5 | external id : 'a -> 'a = "%identity" 6 | 7 | let uncurry f a b = f (a,b) 8 | let curry f (a,b) = f a b 9 | let flip f a b = f b a 10 | let const a _ = a 11 | 12 | let sure f = 13 | function 14 | Some x -> 15 | Some (f x) 16 | | None -> 17 | None 18 | 19 | let option f x = try Some (f x) with Not_found -> None 20 | let maybe f x = try `Val (f x) with e -> `Error e 21 | let tee f x = try ignore @@ f x; x with _ -> x 22 | 23 | type ('a,'b) either = Left of 'a | Right of 'b 24 | 25 | let failwithf fmt = Printf.kprintf (fun s () -> failwith s) fmt 26 | 27 | let assoc x xs = (option @@ List.assoc x) xs 28 | 29 | let string_of_list xs = 30 | Printf.sprintf "[%s]" 31 | @@ String.concat ";" xs 32 | 33 | let rec unfold f init = 34 | match f init with 35 | Some (a, b) -> a :: unfold f b 36 | | None -> [] 37 | 38 | let rec range a b = 39 | if a >= b then 40 | [] 41 | else 42 | a::range (a+1) b 43 | 44 | let rec interperse delim = 45 | function 46 | [] -> [] 47 | | [x] -> [x] 48 | | x::xs -> x::delim::interperse delim xs 49 | 50 | let map_accum_left f init xs = 51 | let f (accum,ys) x = 52 | let accum',y = 53 | f accum x in 54 | (accum',y::ys) in 55 | let accum,ys = 56 | List.fold_left f (init,[]) xs in 57 | accum,List.rev ys 58 | 59 | let rec map_accum_right f init = 60 | function 61 | [] -> 62 | init,[] 63 | | x::xs -> 64 | let (accum,ys) = 65 | map_accum_right f init xs in 66 | let (accum,y) = 67 | f accum x in 68 | accum,y::ys 69 | 70 | let rec filter_map f = 71 | function 72 | x::xs -> 73 | begin match f x with 74 | Some y -> y::filter_map f xs 75 | | None -> filter_map f xs 76 | end 77 | | [] -> 78 | [] 79 | 80 | let rec group_by f = 81 | function 82 | [] -> 83 | [] 84 | | x1::x2::xs when f x1 x2 -> 85 | begin match group_by f @@ x2::xs with 86 | y::ys -> 87 | (x1::y)::ys 88 | | _ -> 89 | failwith "must not happen" 90 | end 91 | | x::xs -> 92 | [x]::group_by f xs 93 | 94 | let index x xs = 95 | let rec loop i = function 96 | [] -> 97 | raise Not_found 98 | | y::ys -> 99 | if x = y then 100 | i 101 | else 102 | loop (i+1) ys in 103 | loop 0 xs 104 | 105 | let string_of_char = 106 | String.make 1 107 | 108 | let hex = 109 | Printf.sprintf "0x%x" 110 | 111 | let open_out_with path f = 112 | let ch = 113 | open_out_bin path in 114 | maybe f ch 115 | +> tee (fun _ -> close_out ch) 116 | +> function 117 | `Val v -> v 118 | | `Error e -> raise e 119 | 120 | let open_in_with path f = 121 | let ch = 122 | open_in_bin path in 123 | maybe f ch 124 | +> tee (fun _ -> close_in ch) 125 | +> function 126 | `Val v -> v 127 | | `Error e -> raise e 128 | 129 | let undefined = Obj.magic 42 130 | let undef = undefined 131 | 132 | let rec format_list (sep : (unit, Format.formatter, unit) format) f ppf = function 133 | | [] -> () 134 | | [x] -> f ppf x 135 | | x::xs -> 136 | Format.fprintf ppf "@[%a@]%t%a" 137 | f x 138 | (fun ppf -> Format.fprintf ppf sep) 139 | (format_list sep f) xs 140 | 141 | let format_ocaml_list f ppf xs = 142 | Format.fprintf ppf "[ @[%a@] ]" 143 | (format_list ";@ " f) xs 144 | 145 | -------------------------------------------------------------------------------- /man/extlib/index_methods.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Index of class methods 31 | 32 | 33 |

Index of class methods

34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |

C
close_in [IO.in_chars]
close_in [IO.in_channel]
close_out [IO.out_chars]
close_out [IO.out_channel]

F
flush [IO.out_chars]
flush [IO.out_channel]

G
get [IO.in_chars]

I
input [IO.in_channel]

O
output [IO.out_channel]

P
put [IO.out_chars]

62 | 63 | -------------------------------------------------------------------------------- /man/extlib/type_Unzip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Unzip 30 | 31 | 32 | sig
33 |   type error_msg =
34 |       Invalid_huffman
35 |     | Invalid_data
36 |     | Invalid_crc
37 |     | Truncated_data
38 |     | Unsupported_dictionary
39 |   exception Error of Unzip.error_msg
40 |   val inflate : ?header:bool -> IO.input -> IO.input
41 |   type t
42 |   val inflate_init : ?header:bool -> IO.input -> Unzip.t
43 |   val inflate_data : Unzip.t -> string -> int -> int -> int
44 | end
-------------------------------------------------------------------------------- /man/extlib/OptParse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | OptParse 35 | 36 | 37 | 41 |

Module OptParse

42 |
43 |
module OptParse: sig .. end
Modules for GNU getopt(3)-style command line parsing.
44 |
45 |
module Opt: sig .. end
46 | This module contains the basic functions and types for defining 47 | new option types and accessing the values of options. 48 |
49 |
module StdOpt: sig .. end
50 | This module contains various standard options. 51 |
52 |
module Formatter: sig .. end
53 | This module contains the types and functions for implementing 54 | custom usage message formatters. 55 |
56 |
module OptParser: sig .. end
57 | This module contains the option parser itself. 58 |
59 | -------------------------------------------------------------------------------- /man/extlib/type_UTF8.Buf.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | UTF8.Buf 30 | 31 | 32 | sig
33 |   type buf
34 |   val create : int -> UTF8.Buf.buf
35 |   val contents : UTF8.Buf.buf -> UTF8.t
36 |   val clear : UTF8.Buf.buf -> unit
37 |   val reset : UTF8.Buf.buf -> unit
38 |   val add_char : UTF8.Buf.buf -> UChar.uchar -> unit
39 |   val add_string : UTF8.Buf.buf -> UTF8.t -> unit
40 |   val add_buffer : UTF8.Buf.buf -> UTF8.Buf.buf -> unit
41 | end
-------------------------------------------------------------------------------- /man/extlib/type_Base64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Base64 30 | 31 | 32 | sig
33 |   exception Invalid_char
34 |   exception Invalid_table
35 |   type encoding_table = char array
36 |   type decoding_table = int array
37 |   val str_encode : ?tbl:Base64.encoding_table -> string -> string
38 |   val str_decode : ?tbl:Base64.decoding_table -> string -> string
39 |   val encode : ?tbl:Base64.encoding_table -> 'IO.output -> 'IO.output
40 |   val decode : ?tbl:Base64.decoding_table -> IO.input -> IO.input
41 |   val make_decoding_table : Base64.encoding_table -> Base64.decoding_table
42 | end
-------------------------------------------------------------------------------- /hList.ml: -------------------------------------------------------------------------------- 1 | open Base 2 | 3 | let rec last = 4 | function 5 | [] -> 6 | invalid_arg "HList.last" 7 | | [x] -> 8 | x 9 | | _::xs -> 10 | last xs 11 | 12 | let init xs = 13 | let rec init' ys = 14 | function 15 | [] -> 16 | invalid_arg "HList.init" 17 | | [_] -> 18 | List.rev ys 19 | | x::xs -> 20 | init' (x::ys) xs in 21 | init' [] xs 22 | 23 | let null = 24 | function 25 | [] -> 26 | true 27 | | _ -> 28 | false 29 | 30 | let fold_left1 f = 31 | function 32 | [] -> 33 | invalid_arg "HList.fold_left1" 34 | | x::xs -> 35 | List.fold_left f x xs 36 | 37 | let rec fold_right1 f = 38 | function 39 | [] -> 40 | invalid_arg "HList.fold_right1" 41 | | [x] -> 42 | x 43 | | x::xs -> 44 | f x (fold_right1 f xs) 45 | 46 | let conj = 47 | List.fold_left (&&) true 48 | 49 | let disj = 50 | List.fold_left (||) false 51 | 52 | let sum = 53 | List.fold_left (+) 0 54 | 55 | let product = 56 | List.fold_left ( * ) 1 57 | 58 | let concat_map f xs = 59 | List.fold_right ((@) $ f) xs [] 60 | 61 | let maximum xs = 62 | fold_left1 max xs 63 | 64 | let minimum xs = 65 | fold_left1 min xs 66 | 67 | let rec scanl f y = 68 | function 69 | [] -> 70 | [y] 71 | | x::xs -> 72 | y::scanl f (f y x) xs 73 | 74 | let scanl1 f = 75 | function 76 | [] -> 77 | [] 78 | | x::xs -> 79 | scanl f x xs 80 | 81 | let rec scanr f z = 82 | function 83 | [] -> 84 | [z] 85 | | x::xs -> 86 | match scanr f z xs with 87 | y::_ as yss -> 88 | (f x y) :: yss 89 | | _ -> 90 | failwith "must not happen" 91 | 92 | let scanr1 f = 93 | function 94 | [] -> 95 | [] 96 | | x::xs -> 97 | scanr f x xs 98 | 99 | let replicate n x = 100 | let rec loop i ys = 101 | if i = 0 then 102 | ys 103 | else 104 | loop (i-1) (x::ys) in 105 | loop n [] 106 | 107 | let rec take n = 108 | function 109 | [] -> 110 | [] 111 | | x::xs -> 112 | if n <= 0 then 113 | [] 114 | else 115 | x :: take (n - 1) xs 116 | 117 | let rec drop n = 118 | function 119 | [] -> 120 | [] 121 | | xs when n <= 0 -> 122 | xs 123 | | _::xs -> 124 | drop (n-1) xs 125 | 126 | let rec splitAt n xs = 127 | match n,xs with 128 | 0,_ | _,[] -> 129 | [],xs 130 | | _,y::ys -> 131 | let p,q = 132 | splitAt (n-1) ys in 133 | y::p,q 134 | 135 | let rec takeWhile f = 136 | function 137 | x::xs when f x -> 138 | x :: takeWhile f xs 139 | | _ -> 140 | [] 141 | 142 | let rec dropWhile f = 143 | function 144 | x::xs when f x -> 145 | dropWhile f xs 146 | | xs -> 147 | xs 148 | 149 | let rec span f = 150 | function 151 | x::xs when f x -> 152 | let ys,zs = 153 | span f xs in 154 | x::ys,zs 155 | | xs -> 156 | [],xs 157 | 158 | let break f = 159 | span (not $ f) 160 | 161 | let rec zip_with f xs ys = 162 | match xs,ys with 163 | [],_ | _,[] -> 164 | [] 165 | | x::xs',y::ys' -> 166 | (f x y)::zip_with f xs' ys' 167 | 168 | let rec zip_with3 f xs ys zs = 169 | match xs,ys,zs with 170 | [],_,_ | _,[],_ | _,_,[] -> 171 | [] 172 | | x::xs',y::ys',z::zs' -> 173 | (f x y z)::zip_with3 f xs' ys' zs' 174 | 175 | let zip xs ys = 176 | zip_with (fun x y -> (x,y)) xs ys 177 | 178 | let zip3 xs ys zs = 179 | zip_with3 (fun x y z -> (x,y,z)) xs ys zs 180 | 181 | let unzip xs = 182 | List.fold_right (fun (x,y) (xs,ys) -> (x::xs,y::ys)) xs ([],[]) 183 | 184 | let unzip3 xs = 185 | List.fold_right (fun (x,y,z) (xs,ys,zs) -> (x::xs,y::ys,z::zs)) xs ([],[],[]) 186 | 187 | let lookup x xs = 188 | try 189 | Some (List.assoc x xs) 190 | with Not_found -> 191 | None 192 | -------------------------------------------------------------------------------- /man/extlib/type_Global.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Global 30 | 31 | 32 | sig
33 |   type 'a t
34 |   exception Global_not_initialized of string
35 |   val empty : string -> 'Global.t
36 |   val name : 'Global.t -> string
37 |   val set : 'Global.t -> '-> unit
38 |   val get : 'Global.t -> 'a
39 |   val undef : 'Global.t -> unit
40 |   val isdef : 'Global.t -> bool
41 |   val opt : 'Global.t -> 'a option
42 | end
-------------------------------------------------------------------------------- /man/extlib/type_Option.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Option 30 | 31 | 32 | sig
33 |   val may : ('-> unit) -> 'a option -> unit
34 |   val map : ('-> 'b) -> 'a option -> 'b option
35 |   val default : '-> 'a option -> 'a
36 |   val map_default : ('-> 'b) -> '-> 'a option -> 'b
37 |   val is_none : 'a option -> bool
38 |   val is_some : 'a option -> bool
39 |   val get : 'a option -> 'a
40 |   exception No_value
41 | end
-------------------------------------------------------------------------------- /man/extlib/IO.BigEndian.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | IO.BigEndian 33 | 34 | 35 | 37 |

Module IO.BigEndian

38 |
39 |
module BigEndian: sig .. end
Same as operations above, but use big-endian encoding
40 |
41 |
val read_ui16 : IO.input -> int
val read_i16 : IO.input -> int
val read_i32 : IO.input -> int
val read_real_i32 : IO.input -> int32
val read_i64 : IO.input -> int64
val read_double : IO.input -> float
val write_ui16 : 'a IO.output -> int -> unit
val write_i16 : 'a IO.output -> int -> unit
val write_i32 : 'a IO.output -> int -> unit
val write_real_i32 : 'a IO.output -> int32 -> unit
val write_i64 : 'a IO.output -> int64 -> unit
val write_double : 'a IO.output -> float -> unit
-------------------------------------------------------------------------------- /templates/search.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | ::query_html:: - OCaml API search 12 | 13 | 14 | 21 | 22 |

Results ::from:: - ::to:: of ::count_html:: for ::query_html::.

23 | 24 | 25 | ::if(found):: 26 | ::table(result):: 27 | 28 | 32 | ::if(is_value):: 33 | 37 | ::end:: 38 | 39 | ::if(is_type):: 40 | 48 | ::end:: 49 | 50 | ::if(is_module):: 51 | 52 | ::end:: 53 | 54 | ::if(is_module_type):: 55 | 56 | ::end:: 57 | 58 | ::if(is_class):: 59 | 60 | ::end:: 61 | 62 | ::if(is_class_type):: 63 | 64 | ::end:: 65 | 66 | 67 | ::end:: 68 | ::else:: 69 |

no such result

70 | ::end:: 71 |
29 | ::module_html::
30 | ::package_html:: 31 |
34 | val ::name_html:: :: 35 | ::type_html:: 36 | 41 | type ::name_html:: = 42 | ::if(is_abstract):: 43 | <abst> 44 | ::else:: 45 | ::type_html:: 46 | ::end:: 47 | module ::name_html::module type ::name_html::class ::name_html::class type ::name_html::
72 | 73 | 96 | 97 | 104 | 107 |
MIZUNO Hiroki © 2010
108 | 112 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /man/extlib/type_UChar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | UChar 30 | 31 | 32 | sig
33 |   type t
34 |   exception Out_of_range
35 |   val char_of : UChar.t -> char
36 |   val of_char : char -> UChar.t
37 |   val code : UChar.t -> int
38 |   val chr : int -> UChar.t
39 |   external uint_code : UChar.t -> int = "%identity"
40 |   val chr_of_uint : int -> UChar.t
41 |   external unsafe_chr_of_uint : int -> UChar.t = "%identity"
42 |   val eq : UChar.t -> UChar.t -> bool
43 |   val compare : UChar.t -> UChar.t -> int
44 |   type uchar = UChar.t
45 |   val int_of_uchar : UChar.uchar -> int
46 |   val uchar_of_int : int -> UChar.uchar
47 | end
-------------------------------------------------------------------------------- /man/stdlib/index_classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Index of classes 72 | 73 | 74 |

Index of classes

75 | 76 |

77 | 78 | -------------------------------------------------------------------------------- /man/stdlib/index_class_types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Index of class types 72 | 73 | 74 |

Index of class types

75 | 76 |

77 | 78 | -------------------------------------------------------------------------------- /man/stdlib/index_methods.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Index of class methods 72 | 73 | 74 |

Index of class methods

75 | 76 |

77 | 78 | -------------------------------------------------------------------------------- /man/stdlib/index_attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Index of class attributes 72 | 73 | 74 |

Index of class attributes

75 | 76 |

77 | 78 | -------------------------------------------------------------------------------- /man/stdlib/type_MoreLabels.Map.OrderedType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | MoreLabels.Map.OrderedType 71 | 72 | 73 | Map.OrderedType -------------------------------------------------------------------------------- /man/stdlib/type_MoreLabels.Set.OrderedType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | MoreLabels.Set.OrderedType 71 | 72 | 73 | Set.OrderedType -------------------------------------------------------------------------------- /man/stdlib/type_MoreLabels.Hashtbl.HashedType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | MoreLabels.Hashtbl.HashedType 71 | 72 | 73 | Hashtbl.HashedType -------------------------------------------------------------------------------- /man/extlib/UTF8.Buf.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | UTF8.Buf 33 | 34 | 35 | 37 |

Module UTF8.Buf

38 |
39 |
module Buf: sig .. end
Buffer module for UTF-8 strings
40 |
41 |
type buf 
42 |
43 | Buffers for UTF-8 strings.
44 |
45 | 46 |
val create : int -> buf
47 | create n creates a buffer with the initial size n-bytes.
48 |
49 |
val contents : buf -> UTF8.t
50 | contents buf returns the contents of the buffer.
51 |
52 |
val clear : buf -> unit
53 | Empty the buffer, 54 | but retains the internal storage which was holding the contents
55 |
56 |
val reset : buf -> unit
57 | Empty the buffer and de-allocate the internal storage.
58 |
59 |
val add_char : buf -> UChar.uchar -> unit
60 | Add one Unicode character to the buffer.
61 |
62 |
val add_string : buf -> UTF8.t -> unit
63 | Add the UTF-8 string to the buffer.
64 |
65 |
val add_buffer : buf -> buf -> unit
66 | add_buffer b1 b2 adds the contents of b2 to b1. 67 | The contents of b2 is not changed.
68 |
69 | -------------------------------------------------------------------------------- /man/extlib/type_IO.BigEndian.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | IO.BigEndian 30 | 31 | 32 | sig
33 |   val read_ui16 : IO.input -> int
34 |   val read_i16 : IO.input -> int
35 |   val read_i32 : IO.input -> int
36 |   val read_real_i32 : IO.input -> int32
37 |   val read_i64 : IO.input -> int64
38 |   val read_double : IO.input -> float
39 |   val write_ui16 : 'IO.output -> int -> unit
40 |   val write_i16 : 'IO.output -> int -> unit
41 |   val write_i32 : 'IO.output -> int -> unit
42 |   val write_real_i32 : 'IO.output -> int32 -> unit
43 |   val write_i64 : 'IO.output -> int64 -> unit
44 |   val write_double : 'IO.output -> float -> unit
45 | end
-------------------------------------------------------------------------------- /man/extlib/RefList.Index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | RefList.Index 33 | 34 | 35 | 37 |

Module RefList.Index

38 |
39 |
module Index: sig .. end
Functions that operate on the ith element of a list. 40 |

41 | 42 | While it is sometimes necessary to perform these 43 | operations on lists (hence their inclusion here), the 44 | functions were moved to an inner module to prevent 45 | their overuse: all functions work in O(n) time. You 46 | might prefer to use Array or DynArray for constant 47 | time indexed element access.
48 |


49 |
val index_of : 'a RefList.t -> 'a -> int
50 | Return the index (position : 0 starting) of an element in 51 | a ref list, using ( = ) for testing element equality 52 | raise Not_found if no element was found
53 |
54 |
val index : ('a -> bool) -> 'a RefList.t -> int
55 | Return the index (position : 0 starting) of an element in 56 | a ref list, using the specified comparator 57 | raise Not_found if no element was found
58 |
59 |
val at_index : 'a RefList.t -> int -> 'a
60 | Return the element of ref list at the specified index 61 | raise Invalid_index if the index is outside 0 ; length-1
62 |
63 |
val set : 'a RefList.t -> int -> 'a -> unit
64 | Change the element at the specified index 65 | raise Invalid_index if the index is outside 0 ; length-1
66 |
67 |
val remove_at : 'a RefList.t -> int -> unit
68 | Remove the element at the specified index 69 | raise Invalid_index if the index is outside 0 ; length-1
70 |
71 | -------------------------------------------------------------------------------- /man/stdlib/type_Map.OrderedType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Map.OrderedType 71 | 72 | 73 | sig type t val compare : Map.OrderedType.t -> Map.OrderedType.t -> int end -------------------------------------------------------------------------------- /man/stdlib/type_Set.OrderedType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Set.OrderedType 71 | 72 | 73 | sig type t val compare : Set.OrderedType.t -> Set.OrderedType.t -> int end -------------------------------------------------------------------------------- /man/extlib/type_Std.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Std 30 | 31 | 32 | sig
33 |   val input_lines : Pervasives.in_channel -> string Enum.t
34 |   val input_chars : Pervasives.in_channel -> char Enum.t
35 |   val input_list : Pervasives.in_channel -> string list
36 |   val input_all : Pervasives.in_channel -> string
37 |   val print_bool : bool -> unit
38 |   val prerr_bool : bool -> unit
39 |   val input_file : ?bin:bool -> string -> string
40 |   val output_file : filename:string -> text:string -> unit
41 |   val string_of_char : char -> string
42 |   external identity : '-> 'a = "%identity"
43 |   val unique : unit -> int
44 |   val dump : '-> string
45 |   val print : '-> unit
46 |   val finally : (unit -> unit) -> ('-> 'b) -> '-> 'b
47 | end
-------------------------------------------------------------------------------- /man/stdlib/type_Callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Callback 71 | 72 | 73 | sig
74 |   val register : string -> '-> unit
75 |   val register_exception : string -> exn -> unit
76 | end
-------------------------------------------------------------------------------- /man/extlib/Unzip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | Unzip 34 | 35 | 36 | 39 |

Module Unzip

40 |
41 |
module Unzip: sig .. end
Decompression algorithm. 42 |

43 | 44 | Unzip decompression algorithm is compliant with RFC 1950 and 1951 which 45 | are describing the "inflate" algorithm used in most popular file formats. 46 | This format is also the one used by the popular ZLib library.
47 |


48 |
type error_msg = 49 | 50 | 52 | 54 | 55 | 56 | 57 | 59 | 61 | 62 | 63 | 64 | 66 | 68 | 69 | 70 | 71 | 73 | 75 | 76 | 77 | 78 | 80 | 82 | 83 |
51 | | 53 | Invalid_huffman
58 | | 60 | Invalid_data
65 | | 67 | Invalid_crc
72 | | 74 | Truncated_data
79 | | 81 | Unsupported_dictionary
84 | 85 | 86 |
exception Error of error_msg
87 |
val inflate : ?header:bool -> IO.input -> IO.input
88 | wrap an input using "inflate" decompression algorithm. raises Error if 89 | an error occurs (this can only be caused by malformed input data).
90 |
91 |
type t 
92 | 93 |
val inflate_init : ?header:bool -> IO.input -> t
val inflate_data : t -> string -> int -> int -> int
-------------------------------------------------------------------------------- /man/stdlib/type_Hashtbl.HashedType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Hashtbl.HashedType 71 | 72 | 73 | sig
74 |   type t
75 |   val equal : Hashtbl.HashedType.t -> Hashtbl.HashedType.t -> bool
76 |   val hash : Hashtbl.HashedType.t -> int
77 | end
-------------------------------------------------------------------------------- /man/extlib/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |

35 | Index of types
36 | Index of exceptions
37 | Index of values
38 | Index of class methods
39 | Index of classes
40 | Index of modules
41 |

42 | 43 | 47 | 51 | 55 | 59 | 63 | 67 | 71 | 75 | 79 | 83 | 87 | 91 | 95 | 99 | 103 | 107 | 111 | 115 | 119 |
Base64
44 | Base64 codec. 45 |
46 |
BitSet
48 | Efficient bit sets. 49 |
50 |
Dllist
52 | A mutable, imperative, circular, doubly linked list library 53 |
54 |
DynArray
56 | Dynamic arrays. 57 |
58 |
Enum
60 | Enumeration over abstract collection of elements. 61 |
62 |
ExtArray
64 | Additional and modified functions for arrays. 65 |
66 |
ExtHashtbl
68 | Extra functions over hashtables. 69 |
70 |
ExtList
72 | Additional and modified functions for lists. 73 |
74 |
ExtString
76 | Additional functions for string manipulations. 77 |
78 |
Global
80 | Mutable global variable. 81 |
82 |
IO
84 | High-order abstract I/O. 85 |
86 |
OptParse
88 | Modules for GNU getopt(3)-style command line parsing. 89 |
90 |
Option
92 | Functions for the option type. 93 |
94 |
PMap
96 | Polymorphic Map. 97 |
98 |
RefList
100 | Reference on lists. 101 |
102 |
Std
104 | Additional functions. 105 |
106 |
UChar
108 | Unicode (ISO-UCS) characters. 109 |
110 |
UTF8
112 | UTF-8 encoded Unicode strings. 113 |
114 |
Unzip
116 | Decompression algorithm. 117 |
118 |
120 | 121 | -------------------------------------------------------------------------------- /man/stdlib/type_Mutex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Mutex 71 | 72 | 73 | sig
74 |   type t
75 |   val create : unit -> Mutex.t
76 |   val lock : Mutex.t -> unit
77 |   val try_lock : Mutex.t -> bool
78 |   val unlock : Mutex.t -> unit
79 | end
-------------------------------------------------------------------------------- /man/extlib/Global.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Global 35 | 36 | 37 | 41 |

Module Global

42 |
43 |
module Global: sig .. end
Mutable global variable. 44 |

45 | 46 | Often in OCaml you want to have a global variable, which is mutable 47 | and uninitialized when declared. You can use a 'a option ref but 48 | this is not very convenient. The Global module provides functions 49 | to easily create and manipulate such variables.
50 |


51 |
type 'a t 
52 |
53 | Abstract type of a global
54 |
55 | 56 |
exception Global_not_initialized of string
57 |
58 | Raised when a global variable is accessed without first having been 59 | assigned a value. The parameter contains the name of the global.
60 |
61 |
val empty : string -> 'a t
62 | Returns an new named empty global. The name of the global can be any 63 | string. It identifies the global and makes debugging easier.
64 |
65 |
val name : 'a t -> string
66 | Retrieve the name of a global.
67 |
68 |
val set : 'a t -> 'a -> unit
69 | Set the global value contents.
70 |
71 |
val get : 'a t -> 'a
72 | Get the global value contents - raise Global_not_initialized if not 73 | defined.
74 |
75 |
val undef : 'a t -> unit
76 | Reset the global value contents to undefined.
77 |
78 |
val isdef : 'a t -> bool
79 | Return true if the global value has been set.
80 |
81 |
val opt : 'a t -> 'a option
82 | Return None if the global is undefined, else Some v where v is the 83 | current global value contents.
84 |
85 | -------------------------------------------------------------------------------- /man/stdlib/type_Oo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Oo 71 | 72 | 73 | sig
74 |   val copy : (< .. > as 'a) -> 'a
75 |   external id : < .. > -> int = "%field1"
76 |   val new_method : string -> CamlinternalOO.tag
77 |   val public_method_label : string -> CamlinternalOO.tag
78 | end
-------------------------------------------------------------------------------- /man/stdlib/type_Condition.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Condition 71 | 72 | 73 | sig
74 |   type t
75 |   val create : unit -> Condition.t
76 |   val wait : Condition.t -> Mutex.t -> unit
77 |   val signal : Condition.t -> unit
78 |   val broadcast : Condition.t -> unit
79 | end
--------------------------------------------------------------------------------