Skip to content
This repository
Browse code

Avoid signature duplication by using the 'module type of' construct.

git-svn-id: svn+ssh://yquem.inria.fr/net/yquem/devel/caml/svn/ocaml/version/3.12@11058 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
commit 392ffd8b6697cd3f0309fbae31c19751c1a99796 1 parent 5e506ba
xclerc authored
1  ocamlbuild/ocamlbuild_pack.mlpack
... ... @@ -1,7 +1,6 @@
1 1 Log
2 2 My_unix
3 3 My_std
4   -Std_signatures
5 4 Signatures
6 5 Shell
7 6 Display
4 ocamlbuild/signatures.mli
@@ -35,7 +35,7 @@ module type LIST = sig
35 35 val union : 'a list -> 'a list -> 'a list
36 36
37 37 (* Original functions *)
38   - include Std_signatures.LIST
  38 + include module type of List
39 39 end
40 40
41 41 module type STRING = sig
@@ -89,7 +89,7 @@ module type STRING = sig
89 89 val explode : string -> char list
90 90
91 91 (** The following are original functions from the [String] module. *)
92   - include Std_signatures.STRING
  92 + include module type of String
93 93 end
94 94
95 95 module type TAGS = sig
94 ocamlbuild/std_signatures.mli
... ... @@ -1,94 +0,0 @@
1   -(***********************************************************************)
2   -(* ocamlbuild *)
3   -(* *)
4   -(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
5   -(* *)
6   -(* Copyright 2007 Institut National de Recherche en Informatique et *)
7   -(* en Automatique. All rights reserved. This file is distributed *)
8   -(* under the terms of the Q Public License version 1.0. *)
9   -(* *)
10   -(***********************************************************************)
11   -
12   -
13   -(* Original author: Nicolas Pouillard *)
14   -(** Some signatures from the standard library. *)
15   -
16   -module type LIST = sig
17   - val length : 'a list -> int
18   - val hd : 'a list -> 'a
19   - val tl : 'a list -> 'a list
20   - val nth : 'a list -> int -> 'a
21   - val rev : 'a list -> 'a list
22   - val append : 'a list -> 'a list -> 'a list
23   - val rev_append : 'a list -> 'a list -> 'a list
24   - val concat : 'a list list -> 'a list
25   - val flatten : 'a list list -> 'a list
26   - val iter : ('a -> unit) -> 'a list -> unit
27   - val map : ('a -> 'b) -> 'a list -> 'b list
28   - val rev_map : ('a -> 'b) -> 'a list -> 'b list
29   - val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
30   - val fold_right : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
31   - val iter2 : ('a -> 'b -> unit) -> 'a list -> 'b list -> unit
32   - val map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
33   - val rev_map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
34   - val fold_left2 : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'a
35   - val fold_right2 :
36   - ('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c
37   - val for_all : ('a -> bool) -> 'a list -> bool
38   - val exists : ('a -> bool) -> 'a list -> bool
39   - val for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
40   - val exists2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
41   - val mem : 'a -> 'a list -> bool
42   - val memq : 'a -> 'a list -> bool
43   - val find : ('a -> bool) -> 'a list -> 'a
44   - val filter : ('a -> bool) -> 'a list -> 'a list
45   - val find_all : ('a -> bool) -> 'a list -> 'a list
46   - val partition : ('a -> bool) -> 'a list -> 'a list * 'a list
47   - val assoc : 'a -> ('a * 'b) list -> 'b
48   - val assq : 'a -> ('a * 'b) list -> 'b
49   - val mem_assoc : 'a -> ('a * 'b) list -> bool
50   - val mem_assq : 'a -> ('a * 'b) list -> bool
51   - val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list
52   - val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
53   - val split : ('a * 'b) list -> 'a list * 'b list
54   - val combine : 'a list -> 'b list -> ('a * 'b) list
55   - val sort : ('a -> 'a -> int) -> 'a list -> 'a list
56   - val stable_sort : ('a -> 'a -> int) -> 'a list -> 'a list
57   - val fast_sort : ('a -> 'a -> int) -> 'a list -> 'a list
58   - val merge : ('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
59   -end
60   -
61   -module type STRING = sig
62   - external length : string -> int = "%string_length"
63   - external get : string -> int -> char = "%string_safe_get"
64   - external set : string -> int -> char -> unit = "%string_safe_set"
65   - external create : int -> string = "caml_create_string"
66   - val make : int -> char -> string
67   - val copy : string -> string
68   - val sub : string -> int -> int -> string
69   - val fill : string -> int -> int -> char -> unit
70   - val blit : string -> int -> string -> int -> int -> unit
71   - val concat : string -> string list -> string
72   - val iter : (char -> unit) -> string -> unit
73   - val escaped : string -> string
74   - val index : string -> char -> int
75   - val rindex : string -> char -> int
76   - val index_from : string -> int -> char -> int
77   - val rindex_from : string -> int -> char -> int
78   - val contains : string -> char -> bool
79   - val contains_from : string -> int -> char -> bool
80   - val rcontains_from : string -> int -> char -> bool
81   - val uppercase : string -> string
82   - val lowercase : string -> string
83   - val capitalize : string -> string
84   - val uncapitalize : string -> string
85   - type t = string
86   - val compare : t -> t -> int
87   - external unsafe_get : string -> int -> char = "%string_unsafe_get"
88   - external unsafe_set : string -> int -> char -> unit
89   - = "%string_unsafe_set"
90   - external unsafe_blit : string -> int -> string -> int -> int -> unit
91   - = "caml_blit_string" "noalloc"
92   - external unsafe_fill : string -> int -> int -> char -> unit
93   - = "caml_fill_string" "noalloc"
94   -end

0 comments on commit 392ffd8

Please sign in to comment.
Something went wrong with that request. Please try again.