1Stdlib(3) OCaml library Stdlib(3)
2
3
4
6 Stdlib - The OCaml Standard library.
7
9 Module Stdlib
10
12 Module Stdlib
13 : sig end
14
15
16 The OCaml Standard library.
17
18 This module is automatically opened at the beginning of each compila‐
19 tion. All components of this module can therefore be referred by their
20 short name, without prefixing them by Stdlib .
21
22 It particular, it provides the basic operations over the built-in types
23 (numbers, booleans, byte sequences, strings, exceptions, references,
24 lists, arrays, input-output channels, ...) and the modules .
25
26
27
28
29
30
31
32 Exceptions
33 val raise : exn -> 'a
34
35 Raise the given exception value
36
37
38
39 val raise_notrace : exn -> 'a
40
41 A faster version raise which does not record the backtrace.
42
43
44 Since 4.02.0
45
46
47
48 val invalid_arg : string -> 'a
49
50 Raise exception Invalid_argument with the given string.
51
52
53
54 val failwith : string -> 'a
55
56 Raise exception Failure with the given string.
57
58
59
60 exception Exit
61
62
63 The Exit exception is not raised by any library function. It is pro‐
64 vided for use in your programs.
65
66
67
68 exception Match_failure of (string * int * int)
69
70
71 Exception raised when none of the cases of a pattern-matching apply.
72 The arguments are the location of the match keyword in the source code
73 (file name, line number, column number).
74
75
76
77 exception Assert_failure of (string * int * int)
78
79
80 Exception raised when an assertion fails. The arguments are the loca‐
81 tion of the assert keyword in the source code (file name, line number,
82 column number).
83
84
85
86 exception Invalid_argument of string
87
88
89 Exception raised by library functions to signal that the given argu‐
90 ments do not make sense. The string gives some information to the pro‐
91 grammer. As a general rule, this exception should not be caught, it
92 denotes a programming error and the code should be modified not to
93 trigger it.
94
95
96
97 exception Failure of string
98
99
100 Exception raised by library functions to signal that they are undefined
101 on the given arguments. The string is meant to give some information to
102 the programmer; you must not pattern match on the string literal
103 because it may change in future versions (use Failure _ instead).
104
105
106
107 exception Not_found
108
109
110 Exception raised by search functions when the desired object could not
111 be found.
112
113
114
115 exception Out_of_memory
116
117
118 Exception raised by the garbage collector when there is insufficient
119 memory to complete the computation. (Not reliable for allocations on
120 the minor heap.)
121
122
123
124 exception Stack_overflow
125
126
127 Exception raised by the bytecode interpreter when the evaluation stack
128 reaches its maximal size. This often indicates infinite or excessively
129 deep recursion in the user's program.
130
131 Before 4.10, it was not fully implemented by the native-code compiler.
132
133
134
135 exception Sys_error of string
136
137
138 Exception raised by the input/output functions to report an operating
139 system error. The string is meant to give some information to the pro‐
140 grammer; you must not pattern match on the string literal because it
141 may change in future versions (use Sys_error _ instead).
142
143
144
145 exception End_of_file
146
147
148 Exception raised by input functions to signal that the end of file has
149 been reached.
150
151
152
153 exception Division_by_zero
154
155
156 Exception raised by integer division and remainder operations when
157 their second argument is zero.
158
159
160
161 exception Sys_blocked_io
162
163
164 A special case of Sys_error raised when no I/O is possible on a
165 non-blocking I/O channel.
166
167
168
169 exception Undefined_recursive_module of (string * int * int)
170
171
172 Exception raised when an ill-founded recursive module definition is
173 evaluated. The arguments are the location of the definition in the
174 source code (file name, line number, column number).
175
176
177
178
179 Comparisons
180 val (=) : 'a -> 'a -> bool
181
182
183 e1 = e2 tests for structural equality of e1 and e2 . Mutable struc‐
184 tures (e.g. references and arrays) are equal if and only if their cur‐
185 rent contents are structurally equal, even if the two mutable objects
186 are not the same physical object. Equality between functional values
187 raises Invalid_argument . Equality between cyclic data structures may
188 not terminate. Left-associative operator, see Ocaml_operators for more
189 information.
190
191
192
193 val (<>) : 'a -> 'a -> bool
194
195 Negation of (=) . Left-associative operator, see Ocaml_operators for
196 more information.
197
198
199
200 val (<) : 'a -> 'a -> bool
201
202 See (>=) . Left-associative operator, see Ocaml_operators for more
203 information.
204
205
206
207 val (>) : 'a -> 'a -> bool
208
209 See (>=) . Left-associative operator, see Ocaml_operators for more
210 information.
211
212
213
214 val (<=) : 'a -> 'a -> bool
215
216 See (>=) . Left-associative operator, see Ocaml_operators for more
217 information.
218
219
220
221 val (>=) : 'a -> 'a -> bool
222
223 Structural ordering functions. These functions coincide with the usual
224 orderings over integers, characters, strings, byte sequences and float‐
225 ing-point numbers, and extend them to a total ordering over all types.
226 The ordering is compatible with ( = ) . As in the case of ( = ) , muta‐
227 ble structures are compared by contents. Comparison between functional
228 values raises Invalid_argument . Comparison between cyclic structures
229 may not terminate. Left-associative operator, see Ocaml_operators for
230 more information.
231
232
233
234 val compare : 'a -> 'a -> int
235
236
237 compare x y returns 0 if x is equal to y , a negative integer if x is
238 less than y , and a positive integer if x is greater than y . The
239 ordering implemented by compare is compatible with the comparison pred‐
240 icates = , < and > defined above, with one difference on the treatment
241 of the float value nan . Namely, the comparison predicates treat nan
242 as different from any other float value, including itself; while com‐
243 pare treats nan as equal to itself and less than any other float value.
244 This treatment of nan ensures that compare defines a total ordering
245 relation.
246
247
248 compare applied to functional values may raise Invalid_argument . com‐
249 pare applied to cyclic structures may not terminate.
250
251 The compare function can be used as the comparison function required by
252 the Set.Make and Map.Make functors, as well as the List.sort and
253 Array.sort functions.
254
255
256
257 val min : 'a -> 'a -> 'a
258
259 Return the smaller of the two arguments. The result is unspecified if
260 one of the arguments contains the float value nan .
261
262
263
264 val max : 'a -> 'a -> 'a
265
266 Return the greater of the two arguments. The result is unspecified if
267 one of the arguments contains the float value nan .
268
269
270
271 val (==) : 'a -> 'a -> bool
272
273
274 e1 == e2 tests for physical equality of e1 and e2 . On mutable types
275 such as references, arrays, byte sequences, records with mutable fields
276 and objects with mutable instance variables, e1 == e2 is true if and
277 only if physical modification of e1 also affects e2 . On non-mutable
278 types, the behavior of ( == ) is implementation-dependent; however, it
279 is guaranteed that e1 == e2 implies compare e1 e2 = 0 . Left-associa‐
280 tive operator, see Ocaml_operators for more information.
281
282
283
284 val (!=) : 'a -> 'a -> bool
285
286 Negation of (==) . Left-associative operator, see Ocaml_operators for
287 more information.
288
289
290
291
292 Boolean operations
293 val not : bool -> bool
294
295 The boolean negation.
296
297
298
299 val (&&) : bool -> bool -> bool
300
301 The boolean 'and'. Evaluation is sequential, left-to-right: in e1 && e2
302 , e1 is evaluated first, and if it returns false , e2 is not evaluated
303 at all. Right-associative operator, see Ocaml_operators for more
304 information.
305
306
307
308 val (&) : bool -> bool -> bool
309
310 Deprecated.
311
312 (&&) should be used instead. Right-associative operator, see
313 Ocaml_operators for more information.
314
315
316
317 val (||) : bool -> bool -> bool
318
319 The boolean 'or'. Evaluation is sequential, left-to-right: in e1 || e2
320 , e1 is evaluated first, and if it returns true , e2 is not evaluated
321 at all. Right-associative operator, see Ocaml_operators for more
322 information.
323
324
325
326 val (or) : bool -> bool -> bool
327
328 Deprecated.
329
330 (||) should be used instead. Right-associative operator, see
331 Ocaml_operators for more information.
332
333
334
335
336 Debugging
337 val __LOC__ : string
338
339
340 __LOC__ returns the location at which this expression appears in the
341 file currently being parsed by the compiler, with the standard error
342 format of OCaml: "File %S, line %d, characters %d-%d".
343
344
345 Since 4.02.0
346
347
348
349 val __FILE__ : string
350
351
352 __FILE__ returns the name of the file currently being parsed by the
353 compiler.
354
355
356 Since 4.02.0
357
358
359
360 val __LINE__ : int
361
362
363 __LINE__ returns the line number at which this expression appears in
364 the file currently being parsed by the compiler.
365
366
367 Since 4.02.0
368
369
370
371 val __MODULE__ : string
372
373
374 __MODULE__ returns the module name of the file being parsed by the com‐
375 piler.
376
377
378 Since 4.02.0
379
380
381
382 val __POS__ : string * int * int * int
383
384
385 __POS__ returns a tuple (file,lnum,cnum,enum) , corresponding to the
386 location at which this expression appears in the file currently being
387 parsed by the compiler. file is the current filename, lnum the line
388 number, cnum the character position in the line and enum the last char‐
389 acter position in the line.
390
391
392 Since 4.02.0
393
394
395
396 val __LOC_OF__ : 'a -> string * 'a
397
398
399 __LOC_OF__ expr returns a pair (loc, expr) where loc is the location of
400 expr in the file currently being parsed by the compiler, with the stan‐
401 dard error format of OCaml: "File %S, line %d, characters %d-%d".
402
403
404 Since 4.02.0
405
406
407
408 val __LINE_OF__ : 'a -> int * 'a
409
410
411 __LINE_OF__ expr returns a pair (line, expr) , where line is the line
412 number at which the expression expr appears in the file currently being
413 parsed by the compiler.
414
415
416 Since 4.02.0
417
418
419
420 val __POS_OF__ : 'a -> (string * int * int * int) * 'a
421
422
423 __POS_OF__ expr returns a pair (loc,expr) , where loc is a tuple
424 (file,lnum,cnum,enum) corresponding to the location at which the
425 expression expr appears in the file currently being parsed by the com‐
426 piler. file is the current filename, lnum the line number, cnum the
427 character position in the line and enum the last character position in
428 the line.
429
430
431 Since 4.02.0
432
433
434
435
436 Composition operators
437 val (|>) : 'a -> ('a -> 'b) -> 'b
438
439 Reverse-application operator: x |> f |> g is exactly equivalent to g (f
440 (x)) . Left-associative operator, see Ocaml_operators for more infor‐
441 mation.
442
443
444 Since 4.01
445
446
447
448 val (@@) : ('a -> 'b) -> 'a -> 'b
449
450 Application operator: g @@ f @@ x is exactly equivalent to g (f (x)) .
451 Right-associative operator, see Ocaml_operators for more information.
452
453
454 Since 4.01
455
456
457
458
459 Integer arithmetic
460 Integers are Sys.int_size bits wide. All operations are taken modulo
461 2^ Sys.int_size . They do not fail on overflow.
462
463 val (~-) : int -> int
464
465 Unary negation. You can also write - e instead of ~- e . Unary opera‐
466 tor, see Ocaml_operators for more information.
467
468
469
470 val (~+) : int -> int
471
472 Unary addition. You can also write + e instead of ~+ e . Unary opera‐
473 tor, see Ocaml_operators for more information.
474
475
476 Since 3.12.0
477
478
479
480 val succ : int -> int
481
482
483 succ x is x + 1 .
484
485
486
487 val pred : int -> int
488
489
490 pred x is x - 1 .
491
492
493
494 val (+) : int -> int -> int
495
496 Integer addition. Left-associative operator, see Ocaml_operators for
497 more information.
498
499
500
501 val (-) : int -> int -> int
502
503 Integer subtraction. Left-associative operator, , see Ocaml_operators
504 for more information.
505
506
507
508 val ( * ) : int -> int -> int
509
510 Integer multiplication. Left-associative operator, see Ocaml_operators
511 for more information.
512
513
514
515 val (/) : int -> int -> int
516
517 Integer division. Integer division rounds the real quotient of its
518 arguments towards zero. More precisely, if x >= 0 and y > 0 , x / y is
519 the greatest integer less than or equal to the real quotient of x by y
520 . Moreover, (- x) / y = x / (- y) = - (x / y) . Left-associative
521 operator, see Ocaml_operators for more information.
522
523
524 Raises Division_by_zero if the second argument is 0.
525
526
527
528 val (mod) : int -> int -> int
529
530 Integer remainder. If y is not zero, the result of x mod y satisfies
531 the following properties: x = (x / y) * y + x mod y and abs(x mod y) <=
532 abs(y) - 1 . If y = 0 , x mod y raises Division_by_zero . Note that x
533 mod y is negative only if x < 0 . Left-associative operator, see
534 Ocaml_operators for more information.
535
536
537 Raises Division_by_zero if y is zero.
538
539
540
541 val abs : int -> int
542
543 Return the absolute value of the argument. Note that this may be nega‐
544 tive if the argument is min_int .
545
546
547
548 val max_int : int
549
550 The greatest representable integer.
551
552
553
554 val min_int : int
555
556 The smallest representable integer.
557
558
559
560
561 Bitwise operations
562 val (land) : int -> int -> int
563
564 Bitwise logical and. Left-associative operator, see Ocaml_operators
565 for more information.
566
567
568
569 val (lor) : int -> int -> int
570
571 Bitwise logical or. Left-associative operator, see Ocaml_operators for
572 more information.
573
574
575
576 val (lxor) : int -> int -> int
577
578 Bitwise logical exclusive or. Left-associative operator, see
579 Ocaml_operators for more information.
580
581
582
583 val lnot : int -> int
584
585 Bitwise logical negation.
586
587
588
589 val (lsl) : int -> int -> int
590
591
592 n lsl m shifts n to the left by m bits. The result is unspecified if m
593 < 0 or m > Sys.int_size . Right-associative operator, see Ocaml_opera‐
594 tors for more information.
595
596
597
598 val (lsr) : int -> int -> int
599
600
601 n lsr m shifts n to the right by m bits. This is a logical shift:
602 zeroes are inserted regardless of the sign of n . The result is
603 unspecified if m < 0 or m > Sys.int_size . Right-associative operator,
604 see Ocaml_operators for more information.
605
606
607
608 val (asr) : int -> int -> int
609
610
611 n asr m shifts n to the right by m bits. This is an arithmetic shift:
612 the sign bit of n is replicated. The result is unspecified if m < 0 or
613 m > Sys.int_size . Right-associative operator, see Ocaml_operators for
614 more information.
615
616
617
618
619 Floating-point arithmetic
620 OCaml's floating-point numbers follow the IEEE 754 standard, using dou‐
621 ble precision (64 bits) numbers. Floating-point operations never raise
622 an exception on overflow, underflow, division by zero, etc. Instead,
623 special IEEE numbers are returned as appropriate, such as infinity for
624 1.0 /. 0.0 , neg_infinity for -1.0 /. 0.0 , and nan ('not a number')
625 for 0.0 /. 0.0 . These special numbers then propagate through float‐
626 ing-point computations as expected: for instance, 1.0 /. infinity is
627 0.0 , and any arithmetic operation with nan as argument returns nan as
628 result.
629
630 val (~-.) : float -> float
631
632 Unary negation. You can also write -. e instead of ~-. e . Unary oper‐
633 ator, see Ocaml_operators for more information.
634
635
636
637 val (~+.) : float -> float
638
639 Unary addition. You can also write +. e instead of ~+. e . Unary oper‐
640 ator, see Ocaml_operators for more information.
641
642
643 Since 3.12.0
644
645
646
647 val (+.) : float -> float -> float
648
649 Floating-point addition. Left-associative operator, see Ocaml_opera‐
650 tors for more information.
651
652
653
654 val (-.) : float -> float -> float
655
656 Floating-point subtraction. Left-associative operator, see Ocaml_oper‐
657 ators for more information.
658
659
660
661 val ( *. ) : float -> float -> float
662
663 Floating-point multiplication. Left-associative operator, see
664 Ocaml_operators for more information.
665
666
667
668 val (/.) : float -> float -> float
669
670 Floating-point division. Left-associative operator, see Ocaml_opera‐
671 tors for more information.
672
673
674
675 val ( ** ) : float -> float -> float
676
677 Exponentiation. Right-associative operator, see Ocaml_operators for
678 more information.
679
680
681
682 val sqrt : float -> float
683
684 Square root.
685
686
687
688 val exp : float -> float
689
690 Exponential.
691
692
693
694 val log : float -> float
695
696 Natural logarithm.
697
698
699
700 val log10 : float -> float
701
702 Base 10 logarithm.
703
704
705
706 val expm1 : float -> float
707
708
709 expm1 x computes exp x -. 1.0 , giving numerically-accurate results
710 even if x is close to 0.0 .
711
712
713 Since 3.12.0
714
715
716
717 val log1p : float -> float
718
719
720 log1p x computes log(1.0 +. x) (natural logarithm), giving numeri‐
721 cally-accurate results even if x is close to 0.0 .
722
723
724 Since 3.12.0
725
726
727
728 val cos : float -> float
729
730 Cosine. Argument is in radians.
731
732
733
734 val sin : float -> float
735
736 Sine. Argument is in radians.
737
738
739
740 val tan : float -> float
741
742 Tangent. Argument is in radians.
743
744
745
746 val acos : float -> float
747
748 Arc cosine. The argument must fall within the range [-1.0, 1.0] .
749 Result is in radians and is between 0.0 and pi .
750
751
752
753 val asin : float -> float
754
755 Arc sine. The argument must fall within the range [-1.0, 1.0] .
756 Result is in radians and is between -pi/2 and pi/2 .
757
758
759
760 val atan : float -> float
761
762 Arc tangent. Result is in radians and is between -pi/2 and pi/2 .
763
764
765
766 val atan2 : float -> float -> float
767
768
769 atan2 y x returns the arc tangent of y /. x . The signs of x and y are
770 used to determine the quadrant of the result. Result is in radians and
771 is between -pi and pi .
772
773
774
775 val hypot : float -> float -> float
776
777
778 hypot x y returns sqrt(x *. x + y *. y) , that is, the length of the
779 hypotenuse of a right-angled triangle with sides of length x and y ,
780 or, equivalently, the distance of the point (x,y) to origin. If one of
781 x or y is infinite, returns infinity even if the other is nan .
782
783
784 Since 4.00.0
785
786
787
788 val cosh : float -> float
789
790 Hyperbolic cosine. Argument is in radians.
791
792
793
794 val sinh : float -> float
795
796 Hyperbolic sine. Argument is in radians.
797
798
799
800 val tanh : float -> float
801
802 Hyperbolic tangent. Argument is in radians.
803
804
805
806 val ceil : float -> float
807
808 Round above to an integer value. ceil f returns the least integer
809 value greater than or equal to f . The result is returned as a float.
810
811
812
813 val floor : float -> float
814
815 Round below to an integer value. floor f returns the greatest integer
816 value less than or equal to f . The result is returned as a float.
817
818
819
820 val abs_float : float -> float
821
822
823 abs_float f returns the absolute value of f .
824
825
826
827 val copysign : float -> float -> float
828
829
830 copysign x y returns a float whose absolute value is that of x and
831 whose sign is that of y . If x is nan , returns nan . If y is nan ,
832 returns either x or -. x , but it is not specified which.
833
834
835 Since 4.00.0
836
837
838
839 val mod_float : float -> float -> float
840
841
842 mod_float a b returns the remainder of a with respect to b . The
843 returned value is a -. n *. b , where n is the quotient a /. b rounded
844 towards zero to an integer.
845
846
847
848 val frexp : float -> float * int
849
850
851 frexp f returns the pair of the significant and the exponent of f .
852 When f is zero, the significant x and the exponent n of f are equal to
853 zero. When f is non-zero, they are defined by f = x *. 2 ** n and 0.5
854 <= x < 1.0 .
855
856
857
858 val ldexp : float -> int -> float
859
860
861 ldexp x n returns x *. 2 ** n .
862
863
864
865 val modf : float -> float * float
866
867
868 modf f returns the pair of the fractional and integral part of f .
869
870
871
872 val float : int -> float
873
874 Same as float_of_int .
875
876
877
878 val float_of_int : int -> float
879
880 Convert an integer to floating-point.
881
882
883
884 val truncate : float -> int
885
886 Same as int_of_float .
887
888
889
890 val int_of_float : float -> int
891
892 Truncate the given floating-point number to an integer. The result is
893 unspecified if the argument is nan or falls outside the range of repre‐
894 sentable integers.
895
896
897
898 val infinity : float
899
900 Positive infinity.
901
902
903
904 val neg_infinity : float
905
906 Negative infinity.
907
908
909
910 val nan : float
911
912 A special floating-point value denoting the result of an undefined
913 operation such as 0.0 /. 0.0 . Stands for 'not a number'. Any float‐
914 ing-point operation with nan as argument returns nan as result. As for
915 floating-point comparisons, = , < , <= , > and >= return false and <>
916 returns true if one or both of their arguments is nan .
917
918
919
920 val max_float : float
921
922 The largest positive finite value of type float .
923
924
925
926 val min_float : float
927
928 The smallest positive, non-zero, non-denormalized value of type float .
929
930
931
932 val epsilon_float : float
933
934 The difference between 1.0 and the smallest exactly representable
935 floating-point number greater than 1.0 .
936
937
938 type fpclass =
939 | FP_normal (* Normal number, none of the below
940 *)
941 | FP_subnormal (* Number very close to 0.0, has reduced precision
942 *)
943 | FP_zero (* Number is 0.0 or -0.0
944 *)
945 | FP_infinite (* Number is positive or negative infinity
946 *)
947 | FP_nan (* Not a number: result of an undefined operation
948 *)
949
950
951 The five classes of floating-point numbers, as determined by the clas‐
952 sify_float function.
953
954
955
956 val classify_float : float -> fpclass
957
958 Return the class of the given floating-point number: normal, subnormal,
959 zero, infinite, or not a number.
960
961
962
963
964 String operations
965 More string operations are provided in module String .
966
967 val (^) : string -> string -> string
968
969 String concatenation. Right-associative operator, see Ocaml_operators
970 for more information.
971
972
973
974
975 Character operations
976 More character operations are provided in module Char .
977
978 val int_of_char : char -> int
979
980 Return the ASCII code of the argument.
981
982
983
984 val char_of_int : int -> char
985
986 Return the character with the given ASCII code.
987
988
989 Raises Invalid_argument if the argument is outside the range 0--255.
990
991
992
993
994 Unit operations
995 val ignore : 'a -> unit
996
997 Discard the value of its argument and return () . For instance,
998 ignore(f x) discards the result of the side-effecting function f . It
999 is equivalent to f x; () , except that the latter may generate a com‐
1000 piler warning; writing ignore(f x) instead avoids the warning.
1001
1002
1003
1004
1005 String conversion functions
1006 val string_of_bool : bool -> string
1007
1008 Return the string representation of a boolean. As the returned values
1009 may be shared, the user should not modify them directly.
1010
1011
1012
1013 val bool_of_string_opt : string -> bool option
1014
1015 Convert the given string to a boolean.
1016
1017 Return None if the string is not "true" or "false" .
1018
1019
1020 Since 4.05
1021
1022
1023
1024 val bool_of_string : string -> bool
1025
1026 Same as bool_of_string_opt , but raise Invalid_argument
1027 "bool_of_string" instead of returning None .
1028
1029
1030
1031 val string_of_int : int -> string
1032
1033 Return the string representation of an integer, in decimal.
1034
1035
1036
1037 val int_of_string_opt : string -> int option
1038
1039 Convert the given string to an integer. The string is read in decimal
1040 (by default, or if the string begins with 0u ), in hexadecimal (if it
1041 begins with 0x or 0X ), in octal (if it begins with 0o or 0O ), or in
1042 binary (if it begins with 0b or 0B ).
1043
1044 The 0u prefix reads the input as an unsigned integer in the range [0,
1045 2*max_int+1] . If the input exceeds max_int it is converted to the
1046 signed integer min_int + input - max_int - 1 .
1047
1048 The _ (underscore) character can appear anywhere in the string and is
1049 ignored.
1050
1051 Return None if the given string is not a valid representation of an
1052 integer, or if the integer represented exceeds the range of integers
1053 representable in type int .
1054
1055
1056 Since 4.05
1057
1058
1059
1060 val int_of_string : string -> int
1061
1062 Same as int_of_string_opt , but raise Failure "int_of_string" instead
1063 of returning None .
1064
1065
1066
1067 val string_of_float : float -> string
1068
1069 Return the string representation of a floating-point number.
1070
1071
1072
1073 val float_of_string_opt : string -> float option
1074
1075 Convert the given string to a float. The string is read in decimal (by
1076 default) or in hexadecimal (marked by 0x or 0X ).
1077
1078 The format of decimal floating-point numbers is [-] dd.ddd (e|E) [+|-]
1079 dd , where d stands for a decimal digit.
1080
1081 The format of hexadecimal floating-point numbers is [-] 0(x|X) hh.hhh
1082 (p|P) [+|-] dd , where h stands for an hexadecimal digit and d for a
1083 decimal digit.
1084
1085 In both cases, at least one of the integer and fractional parts must be
1086 given; the exponent part is optional.
1087
1088 The _ (underscore) character can appear anywhere in the string and is
1089 ignored.
1090
1091 Depending on the execution platforms, other representations of float‐
1092 ing-point numbers can be accepted, but should not be relied upon.
1093
1094 Return None if the given string is not a valid representation of a
1095 float.
1096
1097
1098 Since 4.05
1099
1100
1101
1102 val float_of_string : string -> float
1103
1104 Same as float_of_string_opt , but raise Failure "float_of_string"
1105 instead of returning None .
1106
1107
1108
1109
1110 Pair operations
1111 val fst : 'a * 'b -> 'a
1112
1113 Return the first component of a pair.
1114
1115
1116
1117 val snd : 'a * 'b -> 'b
1118
1119 Return the second component of a pair.
1120
1121
1122
1123
1124 List operations
1125 More list operations are provided in module List .
1126
1127 val (@) : 'a list -> 'a list -> 'a list
1128
1129 List concatenation. Not tail-recursive (length of the first argument).
1130 Right-associative operator, see Ocaml_operators for more information.
1131
1132
1133
1134
1135 Input/output
1136 Note: all input/output functions can raise Sys_error when the system
1137 calls they invoke fail.
1138
1139 type in_channel
1140
1141
1142 The type of input channel.
1143
1144
1145 type out_channel
1146
1147
1148 The type of output channel.
1149
1150
1151
1152 val stdin : in_channel
1153
1154 The standard input for the process.
1155
1156
1157
1158 val stdout : out_channel
1159
1160 The standard output for the process.
1161
1162
1163
1164 val stderr : out_channel
1165
1166 The standard error output for the process.
1167
1168
1169
1170
1171 Output functions on standard output
1172 val print_char : char -> unit
1173
1174 Print a character on standard output.
1175
1176
1177
1178 val print_string : string -> unit
1179
1180 Print a string on standard output.
1181
1182
1183
1184 val print_bytes : bytes -> unit
1185
1186 Print a byte sequence on standard output.
1187
1188
1189 Since 4.02.0
1190
1191
1192
1193 val print_int : int -> unit
1194
1195 Print an integer, in decimal, on standard output.
1196
1197
1198
1199 val print_float : float -> unit
1200
1201 Print a floating-point number, in decimal, on standard output.
1202
1203
1204
1205 val print_endline : string -> unit
1206
1207 Print a string, followed by a newline character, on standard output and
1208 flush standard output.
1209
1210
1211
1212 val print_newline : unit -> unit
1213
1214 Print a newline character on standard output, and flush standard out‐
1215 put. This can be used to simulate line buffering of standard output.
1216
1217
1218
1219
1220 Output functions on standard error
1221 val prerr_char : char -> unit
1222
1223 Print a character on standard error.
1224
1225
1226
1227 val prerr_string : string -> unit
1228
1229 Print a string on standard error.
1230
1231
1232
1233 val prerr_bytes : bytes -> unit
1234
1235 Print a byte sequence on standard error.
1236
1237
1238 Since 4.02.0
1239
1240
1241
1242 val prerr_int : int -> unit
1243
1244 Print an integer, in decimal, on standard error.
1245
1246
1247
1248 val prerr_float : float -> unit
1249
1250 Print a floating-point number, in decimal, on standard error.
1251
1252
1253
1254 val prerr_endline : string -> unit
1255
1256 Print a string, followed by a newline character on standard error and
1257 flush standard error.
1258
1259
1260
1261 val prerr_newline : unit -> unit
1262
1263 Print a newline character on standard error, and flush standard error.
1264
1265
1266
1267
1268 Input functions on standard input
1269 val read_line : unit -> string
1270
1271 Flush standard output, then read characters from standard input until a
1272 newline character is encountered. Return the string of all characters
1273 read, without the newline character at the end.
1274
1275
1276
1277 val read_int_opt : unit -> int option
1278
1279 Flush standard output, then read one line from standard input and con‐
1280 vert it to an integer.
1281
1282 Return None if the line read is not a valid representation of an inte‐
1283 ger.
1284
1285
1286 Since 4.05
1287
1288
1289
1290 val read_int : unit -> int
1291
1292 Same as read_int_opt , but raise Failure "int_of_string" instead of
1293 returning None .
1294
1295
1296
1297 val read_float_opt : unit -> float option
1298
1299 Flush standard output, then read one line from standard input and con‐
1300 vert it to a floating-point number.
1301
1302 Return None if the line read is not a valid representation of a float‐
1303 ing-point number.
1304
1305
1306 Since 4.05.0
1307
1308
1309
1310 val read_float : unit -> float
1311
1312 Same as read_float_opt , but raise Failure "float_of_string" instead of
1313 returning None .
1314
1315
1316
1317
1318 General output functions
1319 type open_flag =
1320 | Open_rdonly (* open for reading.
1321 *)
1322 | Open_wronly (* open for writing.
1323 *)
1324 | Open_append (* open for appending: always write at end of file.
1325 *)
1326 | Open_creat (* create the file if it does not exist.
1327 *)
1328 | Open_trunc (* empty the file if it already exists.
1329 *)
1330 | Open_excl (* fail if Open_creat and the file already exists.
1331 *)
1332 | Open_binary (* open in binary mode (no conversion).
1333 *)
1334 | Open_text (* open in text mode (may perform conversions).
1335 *)
1336 | Open_nonblock (* open in non-blocking mode.
1337 *)
1338
1339
1340 Opening modes for open_out_gen and open_in_gen .
1341
1342
1343
1344 val open_out : string -> out_channel
1345
1346 Open the named file for writing, and return a new output channel on
1347 that file, positioned at the beginning of the file. The file is trun‐
1348 cated to zero length if it already exists. It is created if it does not
1349 already exists.
1350
1351
1352
1353 val open_out_bin : string -> out_channel
1354
1355 Same as open_out , but the file is opened in binary mode, so that no
1356 translation takes place during writes. On operating systems that do not
1357 distinguish between text mode and binary mode, this function behaves
1358 like open_out .
1359
1360
1361
1362 val open_out_gen : open_flag list -> int -> string -> out_channel
1363
1364
1365 open_out_gen mode perm filename opens the named file for writing, as
1366 described above. The extra argument mode specifies the opening mode.
1367 The extra argument perm specifies the file permissions, in case the
1368 file must be created. open_out and open_out_bin are special cases of
1369 this function.
1370
1371
1372
1373 val flush : out_channel -> unit
1374
1375 Flush the buffer associated with the given output channel, performing
1376 all pending writes on that channel. Interactive programs must be care‐
1377 ful about flushing standard output and standard error at the right
1378 time.
1379
1380
1381
1382 val flush_all : unit -> unit
1383
1384 Flush all open output channels; ignore errors.
1385
1386
1387
1388 val output_char : out_channel -> char -> unit
1389
1390 Write the character on the given output channel.
1391
1392
1393
1394 val output_string : out_channel -> string -> unit
1395
1396 Write the string on the given output channel.
1397
1398
1399
1400 val output_bytes : out_channel -> bytes -> unit
1401
1402 Write the byte sequence on the given output channel.
1403
1404
1405 Since 4.02.0
1406
1407
1408
1409 val output : out_channel -> bytes -> int -> int -> unit
1410
1411
1412 output oc buf pos len writes len characters from byte sequence buf ,
1413 starting at offset pos , to the given output channel oc .
1414
1415
1416 Raises Invalid_argument if pos and len do not designate a valid range
1417 of buf .
1418
1419
1420
1421 val output_substring : out_channel -> string -> int -> int -> unit
1422
1423 Same as output but take a string as argument instead of a byte
1424 sequence.
1425
1426
1427 Since 4.02.0
1428
1429
1430
1431 val output_byte : out_channel -> int -> unit
1432
1433 Write one 8-bit integer (as the single character with that code) on the
1434 given output channel. The given integer is taken modulo 256.
1435
1436
1437
1438 val output_binary_int : out_channel -> int -> unit
1439
1440 Write one integer in binary format (4 bytes, big-endian) on the given
1441 output channel. The given integer is taken modulo 2^32. The only
1442 reliable way to read it back is through the input_binary_int function.
1443 The format is compatible across all machines for a given version of
1444 OCaml.
1445
1446
1447
1448 val output_value : out_channel -> 'a -> unit
1449
1450 Write the representation of a structured value of any type to a chan‐
1451 nel. Circularities and sharing inside the value are detected and pre‐
1452 served. The object can be read back, by the function input_value . See
1453 the description of module Marshal for more information. output_value
1454 is equivalent to Marshal.to_channel with an empty list of flags.
1455
1456
1457
1458 val seek_out : out_channel -> int -> unit
1459
1460
1461 seek_out chan pos sets the current writing position to pos for channel
1462 chan . This works only for regular files. On files of other kinds (such
1463 as terminals, pipes and sockets), the behavior is unspecified.
1464
1465
1466
1467 val pos_out : out_channel -> int
1468
1469 Return the current writing position for the given channel. Does not
1470 work on channels opened with the Open_append flag (returns unspecified
1471 results).
1472
1473
1474
1475 val out_channel_length : out_channel -> int
1476
1477 Return the size (number of characters) of the regular file on which the
1478 given channel is opened. If the channel is opened on a file that is
1479 not a regular file, the result is meaningless.
1480
1481
1482
1483 val close_out : out_channel -> unit
1484
1485 Close the given channel, flushing all buffered write operations. Out‐
1486 put functions raise a Sys_error exception when they are applied to a
1487 closed output channel, except close_out and flush , which do nothing
1488 when applied to an already closed channel. Note that close_out may
1489 raise Sys_error if the operating system signals an error when flushing
1490 or closing.
1491
1492
1493
1494 val close_out_noerr : out_channel -> unit
1495
1496 Same as close_out , but ignore all errors.
1497
1498
1499
1500 val set_binary_mode_out : out_channel -> bool -> unit
1501
1502
1503 set_binary_mode_out oc true sets the channel oc to binary mode: no
1504 translations take place during output. set_binary_mode_out oc false
1505 sets the channel oc to text mode: depending on the operating system,
1506 some translations may take place during output. For instance, under
1507 Windows, end-of-lines will be translated from \n to \r\n . This func‐
1508 tion has no effect under operating systems that do not distinguish
1509 between text mode and binary mode.
1510
1511
1512
1513
1514 General input functions
1515 val open_in : string -> in_channel
1516
1517 Open the named file for reading, and return a new input channel on that
1518 file, positioned at the beginning of the file.
1519
1520
1521
1522 val open_in_bin : string -> in_channel
1523
1524 Same as open_in , but the file is opened in binary mode, so that no
1525 translation takes place during reads. On operating systems that do not
1526 distinguish between text mode and binary mode, this function behaves
1527 like open_in .
1528
1529
1530
1531 val open_in_gen : open_flag list -> int -> string -> in_channel
1532
1533
1534 open_in_gen mode perm filename opens the named file for reading, as
1535 described above. The extra arguments mode and perm specify the opening
1536 mode and file permissions. open_in and open_in_bin are special cases
1537 of this function.
1538
1539
1540
1541 val input_char : in_channel -> char
1542
1543 Read one character from the given input channel.
1544
1545
1546 Raises End_of_file if there are no more characters to read.
1547
1548
1549
1550 val input_line : in_channel -> string
1551
1552 Read characters from the given input channel, until a newline character
1553 is encountered. Return the string of all characters read, without the
1554 newline character at the end.
1555
1556
1557 Raises End_of_file if the end of the file is reached at the beginning
1558 of line.
1559
1560
1561
1562 val input : in_channel -> bytes -> int -> int -> int
1563
1564
1565 input ic buf pos len reads up to len characters from the given channel
1566 ic , storing them in byte sequence buf , starting at character number
1567 pos . It returns the actual number of characters read, between 0 and
1568 len (inclusive). A return value of 0 means that the end of file was
1569 reached. A return value between 0 and len exclusive means that not all
1570 requested len characters were read, either because no more characters
1571 were available at that time, or because the implementation found it
1572 convenient to do a partial read; input must be called again to read the
1573 remaining characters, if desired. (See also really_input for reading
1574 exactly len characters.) Exception Invalid_argument "input" is raised
1575 if pos and len do not designate a valid range of buf .
1576
1577
1578
1579 val really_input : in_channel -> bytes -> int -> int -> unit
1580
1581
1582 really_input ic buf pos len reads len characters from channel ic ,
1583 storing them in byte sequence buf , starting at character number pos .
1584
1585
1586 Raises End_of_file if the end of file is reached before len characters
1587 have been read.
1588
1589
1590 Raises Invalid_argument if pos and len do not designate a valid range
1591 of buf .
1592
1593
1594
1595 val really_input_string : in_channel -> int -> string
1596
1597
1598 really_input_string ic len reads len characters from channel ic and
1599 returns them in a new string.
1600
1601
1602 Since 4.02.0
1603
1604
1605 Raises End_of_file if the end of file is reached before len characters
1606 have been read.
1607
1608
1609
1610 val input_byte : in_channel -> int
1611
1612 Same as input_char , but return the 8-bit integer representing the
1613 character.
1614
1615
1616 Raises End_of_file if an end of file was reached.
1617
1618
1619
1620 val input_binary_int : in_channel -> int
1621
1622 Read an integer encoded in binary format (4 bytes, big-endian) from the
1623 given input channel. See output_binary_int .
1624
1625
1626 Raises End_of_file if an end of file was reached while reading the
1627 integer.
1628
1629
1630
1631 val input_value : in_channel -> 'a
1632
1633 Read the representation of a structured value, as produced by out‐
1634 put_value , and return the corresponding value. This function is iden‐
1635 tical to Marshal.from_channel ; see the description of module Marshal
1636 for more information, in particular concerning the lack of type safety.
1637
1638
1639
1640 val seek_in : in_channel -> int -> unit
1641
1642
1643 seek_in chan pos sets the current reading position to pos for channel
1644 chan . This works only for regular files. On files of other kinds, the
1645 behavior is unspecified.
1646
1647
1648
1649 val pos_in : in_channel -> int
1650
1651 Return the current reading position for the given channel.
1652
1653
1654
1655 val in_channel_length : in_channel -> int
1656
1657 Return the size (number of characters) of the regular file on which the
1658 given channel is opened. If the channel is opened on a file that is
1659 not a regular file, the result is meaningless. The returned size does
1660 not take into account the end-of-line translations that can be per‐
1661 formed when reading from a channel opened in text mode.
1662
1663
1664
1665 val close_in : in_channel -> unit
1666
1667 Close the given channel. Input functions raise a Sys_error exception
1668 when they are applied to a closed input channel, except close_in ,
1669 which does nothing when applied to an already closed channel.
1670
1671
1672
1673 val close_in_noerr : in_channel -> unit
1674
1675 Same as close_in , but ignore all errors.
1676
1677
1678
1679 val set_binary_mode_in : in_channel -> bool -> unit
1680
1681
1682 set_binary_mode_in ic true sets the channel ic to binary mode: no
1683 translations take place during input. set_binary_mode_out ic false
1684 sets the channel ic to text mode: depending on the operating system,
1685 some translations may take place during input. For instance, under
1686 Windows, end-of-lines will be translated from \r\n to \n . This func‐
1687 tion has no effect under operating systems that do not distinguish
1688 between text mode and binary mode.
1689
1690
1691
1692
1693 Operations on large files
1694 module LargeFile : sig end
1695
1696
1697 Operations on large files. This sub-module provides 64-bit variants of
1698 the channel functions that manipulate file positions and file sizes.
1699 By representing positions and sizes by 64-bit integers (type int64 )
1700 instead of regular integers (type int ), these alternate functions
1701 allow operating on files whose sizes are greater than max_int .
1702
1703
1704
1705
1706 References
1707 type 'a ref = {
1708
1709 mutable contents : 'a ;
1710 }
1711
1712
1713 The type of references (mutable indirection cells) containing a value
1714 of type 'a .
1715
1716
1717
1718 val ref : 'a -> 'a ref
1719
1720 Return a fresh reference containing the given value.
1721
1722
1723
1724 val (!) : 'a ref -> 'a
1725
1726
1727 !r returns the current contents of reference r . Equivalent to fun r
1728 -> r.contents . Unary operator, see Ocaml_operators for more informa‐
1729 tion.
1730
1731
1732
1733 val (:=) : 'a ref -> 'a -> unit
1734
1735
1736 r := a stores the value of a in reference r . Equivalent to fun r v ->
1737 r.contents <- v . Right-associative operator, see Ocaml_operators for
1738 more information.
1739
1740
1741
1742 val incr : int ref -> unit
1743
1744 Increment the integer contained in the given reference. Equivalent to
1745 fun r -> r := succ !r .
1746
1747
1748
1749 val decr : int ref -> unit
1750
1751 Decrement the integer contained in the given reference. Equivalent to
1752 fun r -> r := pred !r .
1753
1754
1755
1756
1757 Result type
1758 type ('a, 'b) result =
1759 | Ok of 'a
1760 | Error of 'b
1761
1762
1763 Since 4.03.0
1764
1765
1766
1767
1768 Operations on format strings
1769 Format strings are character strings with special lexical conventions
1770 that defines the functionality of formatted input/output functions.
1771 Format strings are used to read data with formatted input functions
1772 from module Scanf and to print data with formatted output functions
1773 from modules Printf and Format .
1774
1775 Format strings are made of three kinds of entities:
1776
1777 -conversions specifications, introduced by the special character '%'
1778 followed by one or more characters specifying what kind of argument to
1779 read or print,
1780
1781 -formatting indications, introduced by the special character '@' fol‐
1782 lowed by one or more characters specifying how to read or print the
1783 argument,
1784
1785 -plain characters that are regular characters with usual lexical con‐
1786 ventions. Plain characters specify string literals to be read in the
1787 input or printed in the output.
1788
1789 There is an additional lexical rule to escape the special characters
1790 '%' and '@' in format strings: if a special character follows a '%'
1791 character, it is treated as a plain character. In other words, "%%" is
1792 considered as a plain '%' and "%@" as a plain '@' .
1793
1794 For more information about conversion specifications and formatting
1795 indications available, read the documentation of modules Scanf , Printf
1796 and Format .
1797
1798 Format strings have a general and highly polymorphic type ('a, 'b, 'c,
1799 'd, 'e, 'f) format6 . The two simplified types, format and format4
1800 below are included for backward compatibility with earlier releases of
1801 OCaml.
1802
1803 The meaning of format string type parameters is as follows:
1804
1805
1806 - 'a is the type of the parameters of the format for formatted output
1807 functions ( printf -style functions); 'a is the type of the values read
1808 by the format for formatted input functions ( scanf -style functions).
1809
1810
1811 - 'b is the type of input source for formatted input functions and the
1812 type of output target for formatted output functions. For printf
1813 -style functions from module Printf , 'b is typically out_channel ; for
1814 printf -style functions from module Format , 'b is typically For‐
1815 mat.formatter ; for scanf -style functions from module Scanf , 'b is
1816 typically Scanf.Scanning.in_channel .
1817
1818 Type argument 'b is also the type of the first argument given to user's
1819 defined printing functions for %a and %t conversions, and user's
1820 defined reading functions for %r conversion.
1821
1822
1823 - 'c is the type of the result of the %a and %t printing functions, and
1824 also the type of the argument transmitted to the first argument of
1825 kprintf -style functions or to the kscanf -style functions.
1826
1827
1828 - 'd is the type of parameters for the scanf -style functions.
1829
1830
1831 - 'e is the type of the receiver function for the scanf -style func‐
1832 tions.
1833
1834
1835 - 'f is the final result type of a formatted input/output function
1836 invocation: for the printf -style functions, it is typically unit ; for
1837 the scanf -style functions, it is typically the result type of the
1838 receiver function.
1839
1840
1841 type ('a, 'b, 'c, 'd, 'e, 'f) format6 = ('a, 'b, 'c, 'd, 'e, 'f) Cam‐
1842 linternalFormatBasics.format6
1843
1844
1845
1846
1847 type ('a, 'b, 'c, 'd) format4 = ('a, 'b, 'c, 'c, 'c, 'd) format6
1848
1849
1850
1851
1852 type ('a, 'b, 'c) format = ('a, 'b, 'c, 'c) format4
1853
1854
1855
1856
1857
1858 val string_of_format : ('a, 'b, 'c, 'd, 'e, 'f) format6 -> string
1859
1860 Converts a format string into a string.
1861
1862
1863
1864 val format_of_string : ('a, 'b, 'c, 'd, 'e, 'f) format6 -> ('a, 'b, 'c,
1865 'd, 'e, 'f) format6
1866
1867
1868 format_of_string s returns a format string read from the string literal
1869 s . Note: format_of_string can not convert a string argument that is
1870 not a literal. If you need this functionality, use the more general
1871 Scanf.format_from_string function.
1872
1873
1874
1875 val (^^) : ('a, 'b, 'c, 'd, 'e, 'f) format6 -> ('f, 'b, 'c, 'e, 'g, 'h)
1876 format6 -> ('a, 'b, 'c, 'd, 'g, 'h) format6
1877
1878
1879 f1 ^^ f2 catenates format strings f1 and f2 . The result is a format
1880 string that behaves as the concatenation of format strings f1 and f2 :
1881 in case of formatted output, it accepts arguments from f1 , then argu‐
1882 ments from f2 ; in case of formatted input, it returns results from f1
1883 , then results from f2 . Right-associative operator, see Ocaml_opera‐
1884 tors for more information.
1885
1886
1887
1888
1889 Program termination
1890 val exit : int -> 'a
1891
1892 Terminate the process, returning the given status code to the operating
1893 system: usually 0 to indicate no errors, and a small positive integer
1894 to indicate failure. All open output channels are flushed with
1895 flush_all . An implicit exit 0 is performed each time a program termi‐
1896 nates normally. An implicit exit 2 is performed if the program termi‐
1897 nates early because of an uncaught exception.
1898
1899
1900
1901 val at_exit : (unit -> unit) -> unit
1902
1903 Register the given function to be called at program termination time.
1904 The functions registered with at_exit will be called when the program
1905 does any of the following:
1906
1907 -executes exit
1908
1909
1910 -terminates, either normally or because of an uncaught exception
1911
1912 -executes the C function caml_shutdown . The functions are called in
1913 'last in, first out' order: the function most recently added with
1914 at_exit is called first.
1915
1916
1917
1918
1919
1920 Standard library modules
1921 module Arg : (module Stdlib__arg)
1922
1923
1924
1925
1926 module Array : (module Stdlib__array)
1927
1928
1929
1930
1931 module ArrayLabels : (module Stdlib__arrayLabels)
1932
1933
1934
1935
1936 module Bigarray : (module Stdlib__bigarray)
1937
1938
1939
1940
1941 module Bool : (module Stdlib__bool)
1942
1943
1944
1945
1946 module Buffer : (module Stdlib__buffer)
1947
1948
1949
1950
1951 module Bytes : (module Stdlib__bytes)
1952
1953
1954
1955
1956 module BytesLabels : (module Stdlib__bytesLabels)
1957
1958
1959
1960
1961 module Callback : (module Stdlib__callback)
1962
1963
1964
1965
1966 module Char : (module Stdlib__char)
1967
1968
1969
1970
1971 module Complex : (module Stdlib__complex)
1972
1973
1974
1975
1976 module Digest : (module Stdlib__digest)
1977
1978
1979
1980
1981 module Ephemeron : (module Stdlib__ephemeron)
1982
1983
1984
1985
1986 module Filename : (module Stdlib__filename)
1987
1988
1989
1990
1991 module Float : (module Stdlib__float)
1992
1993
1994
1995
1996 module Format : (module Stdlib__format)
1997
1998
1999
2000
2001 module Fun : (module Stdlib__fun)
2002
2003
2004
2005
2006 module Gc : (module Stdlib__gc)
2007
2008
2009
2010
2011 module Genlex : (module Stdlib__genlex)
2012
2013
2014
2015
2016 module Hashtbl : (module Stdlib__hashtbl)
2017
2018
2019
2020
2021 module Int : (module Stdlib__int)
2022
2023
2024
2025
2026 module Int32 : (module Stdlib__int32)
2027
2028
2029
2030
2031 module Int64 : (module Stdlib__int64)
2032
2033
2034
2035
2036 module Lazy : (module Stdlib__lazy)
2037
2038
2039
2040
2041 module Lexing : (module Stdlib__lexing)
2042
2043
2044
2045
2046 module List : (module Stdlib__list)
2047
2048
2049
2050
2051 module ListLabels : (module Stdlib__listLabels)
2052
2053
2054
2055
2056 module Map : (module Stdlib__map)
2057
2058
2059
2060
2061 module Marshal : (module Stdlib__marshal)
2062
2063
2064
2065
2066 module MoreLabels : (module Stdlib__moreLabels)
2067
2068
2069
2070
2071 module Nativeint : (module Stdlib__nativeint)
2072
2073
2074
2075
2076 module Obj : (module Stdlib__obj)
2077
2078
2079
2080
2081 module Oo : (module Stdlib__oo)
2082
2083
2084
2085
2086 module Option : (module Stdlib__option)
2087
2088
2089
2090
2091 module Parsing : (module Stdlib__parsing)
2092
2093
2094
2095
2096 module Pervasives : (module Stdlib__pervasives)
2097
2098
2099
2100
2101 module Printexc : (module Stdlib__printexc)
2102
2103
2104
2105
2106 module Printf : (module Stdlib__printf)
2107
2108
2109
2110
2111 module Queue : (module Stdlib__queue)
2112
2113
2114
2115
2116 module Random : (module Stdlib__random)
2117
2118
2119
2120
2121 module Result : (module Stdlib__result)
2122
2123
2124
2125
2126 module Scanf : (module Stdlib__scanf)
2127
2128
2129
2130
2131 module Seq : (module Stdlib__seq)
2132
2133
2134
2135
2136 module Set : (module Stdlib__set)
2137
2138
2139
2140
2141 module Spacetime : (module Stdlib__spacetime)
2142
2143
2144
2145
2146 module Stack : (module Stdlib__stack)
2147
2148
2149
2150
2151 module StdLabels : (module Stdlib__stdLabels)
2152
2153
2154
2155
2156 module Stream : (module Stdlib__stream)
2157
2158
2159
2160
2161 module String : (module Stdlib__string)
2162
2163
2164
2165
2166 module StringLabels : (module Stdlib__stringLabels)
2167
2168
2169
2170
2171 module Sys : (module Stdlib__sys)
2172
2173
2174
2175
2176 module Uchar : (module Stdlib__uchar)
2177
2178
2179
2180
2181 module Unit : (module Stdlib__unit)
2182
2183
2184
2185
2186 module Weak : (module Stdlib__weak)
2187
2188
2189
2190
2191
2192
2193
2194OCamldoc 2020-09-01 Stdlib(3)