Commit Graph

55 Commits (master)

Author SHA1 Message Date
Xavier Leroy 8b7ff3532c
Move the examples of labeled functions to StdLabels (#9976)
In the old days, the interfaces of the labeled modules
(ArrayLabels, BytesLabels, ListLabels, StringLabels)
started with short examples of labelings.

Now, the interfaces of the non-labeled modules
(Array, Bytes, List, String) are automatically generated
from the interfaces of the labeled modules.  As a side effect,
the interfaces of Array, Bytes, List and String also start
with short examples of labelings, which is somewhat strange.

This commit reorganizes the documentation as follows:
- The documentation of the StdLabels module is expanded, and includes
  the examples of labeled functions previously scattered in
  ArrayLabels, BytesLabels, ListLabels, StringLabels.
- Array, Bytes, List, String and their labeled counterparts
  briefly mention the labeled modules and point to StdLabels,
  but no longer contain examples.
2020-10-15 15:07:31 +02:00
Joan Thibault 3e7532a49a
Fixed typo in String.mli (#9936)
Replaced 'escape' by 'escaped'
2020-09-24 14:12:58 +02:00
Daniel Bünzli 2bc93f5791
String documentation improvements (#9891)
* String documentation improvements.

* Regenerate string.mli.
2020-09-23 23:01:35 +02:00
John Whitington fc101ae849 Rename tools/unlabel --> tools/sync_stdlib_docs 2020-09-10 19:17:43 +01:00
John Whitington 53f753d772 remove double @sinces 2020-08-03 15:26:44 +01:00
John Whitington 66638cf700 ~prefix fix 2020-08-03 14:12:58 +01:00
John Whitington 1d68ac08dc Fix deprecations 2020-08-03 13:38:28 +01:00
John Whitington 0af3a1a805 Small fixes from @dra27's comments 2020-08-03 12:46:16 +01:00
John Whitington 1c258b463f Fix label warnings 2020-07-31 15:51:11 +01:00
John Whitington 6e0557f6d7 Labeled and unlabeled @sinces automatically 2020-07-30 17:21:22 +01:00
John Whitington 0fbeee11be Fix smaller review comments from @dra27 2020-07-30 13:26:20 +01:00
John Whitington 85491c8867 Tildes back in labeled modules 2020-07-29 14:58:01 +01:00
John Whitington 7f922569c0 Replacing {!X.y} in doc comments with {!y} 2020-07-27 13:39:12 +01:00
John Whitington 0f2954b263 Fixes per travis check-typo and travis changes 2020-07-08 14:13:08 +01:00
John Whitington f410787b81 Better warning for developers 2020-07-08 12:52:57 +01:00
John Whitington dea23a56c5 Restore String.prefix/suffix status quo ante 2020-07-08 12:23:16 +01:00
John Whitington efe8ca02f1 Unify labeled and unlabeled Standard Library modules 2020-07-07 19:34:14 +01:00
Et7f3 c4851b0ff0
Consistently use @raise tags in Stdlib docs (#8644) 2020-06-30 14:06:45 +01:00
Bernhard Schommer e00d7f3a42
Added String prefix and suffix tests.
The functions test if the second argument is a prefix or suffix of the
first argument.
2020-06-24 12:01:55 +02:00
El-Hassan Wanas 8a614d79de Comment fixes
Co-Authored-By: David Allsopp <david.allsopp@metastack.com>
2019-10-15 14:14:31 +03:00
ElHassan Wanas e271e8fa4d Updated documentation for StringLabels, ArrayLabels, ListLabels and BytesLabels to show StdLabels usage 2019-10-15 12:44:44 +03:00
Daniel Bünzli acb0e91ac6 Stdlib doc: harmonize heading levels again. (#2142) 2018-11-08 17:33:55 +01:00
Jérémie Dimino 9124ab82d1
Deprecate Pervasives (#1605)
- inline Pervasives in Stdlib and re-add Pervasives as a deprecated
module that aliases all elements of Stdlib except the stdlib modules.

- remove special case for Stdlib.Pervasives in printtyp.ml
2018-08-27 12:42:14 +01:00
zapashcanon 6ca69c2546
Fix a typo 2018-04-01 16:58:40 +01:00
Simon Cruanes df80f34a92 Stdlib functional iterators (#1002)
* add `Seq` module, expose iterator conversions in most containers

* small typo

* typo

* change order of arguments for `{Map,Set}.add_seq`

* watch for max string length in `Bytes.of_seq`

* wip: make it build again

* Fix dependency

Sys needs to be linked before Bytes in stdlib.

* Update threads/stdlib.ml

* Update stdlib_no_prefixed/.depend

* fix inconsistencies with label modules

* update testsuite to work with seq

* update change file

* small change in `Hashtbl.to_seq`, capturing only the underlying array

* add some documentation to seq.mli

* revert to good ol' module type names for hashtables

* fix test

* change style of comments in seq.mli

* follow some demands in review of GPR #1002

* some fixes for #1002

* add Seq-related functions to Ephemeron

* add some comments on `Hashtbl.of_seq`

* add more tests for `Hashtbl.{to,of}_seq`

* fix bug in `Ephemeron.to_seq`

* Update Changes
2018-03-16 18:25:10 +01:00
alainfrisch a5b1a39bd2 Fix missing deprecated attribute. 2017-04-05 19:27:06 +02:00
Gabriel Scherer 40ad626cc3 Merge pull request #972 from dra27/string-primitive-compatibility
Make %string_safe_set and %string_unsafe_set deprecated aliases for bytes versions
2017-03-08 20:49:17 -05:00
Török Edwin 20f61d7fb4 Documentation: improve @since annotations
Add missing @since annotations for OCaml versions 4.00.0 - 4.05.0,
and fix existing annotations as needed:

Format.ikprintf: clarify ambiguity on @since 4.0 annotation
See b81519668f

Hashtbl.is_randomized and ListLabels.sort_uniq should be @since 4.03
List.sort_uniq is 4.02 but ListLabels.sort_uniq is 4.03
See:
512d128918
189d29bfcf
2017-02-21 17:11:51 +02:00
Roma Sokolov 4da2b30b98 Adds missing functions to *Labels modules (#875)
This fix makes it possible to use labeled modules as drop-in replacement with
`open StdLabels`.

Added signatures:

```ocaml
(* arrayLabels.mli *)
val iter2 : f:('a -> 'b -> unit) -> 'a array -> 'b array -> unit
val map2 : f:('a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array

(* bytesLabels.mli *)
val extend : bytes -> left:int -> right:int -> bytes
val blit_string :
val cat : bytes -> bytes -> bytes
val uppercase_ascii : bytes -> bytes
val lowercase_ascii : bytes -> bytes
val capitalize_ascii : bytes -> bytes
val uncapitalize_ascii : bytes -> bytes
val equal: t -> t -> bool

(* listLabels.mli *)
val compare_lengths : 'a list -> 'b list -> int
val compare_length_with : 'a list -> len:int -> int
val cons : 'a -> 'a list -> 'a list

(* moreLabels.Hashtbl *)
val is_randomized : unit -> bool

(* stringLabels.mli *)
val uppercase_ascii : string -> string
val lowercase_ascii : string -> string
val capitalize_ascii : string -> string
val uncapitalize_ascii : string -> string
val equal: t -> t -> bool
val split_on_char: sep:char -> string -> string list
```
2017-01-03 15:03:05 +01:00
Damien Doligez 4b9e196d52 restore compatibility for String.{unsafe_set,create,fill} 2016-12-14 13:20:17 +00:00
Hongbo Zhang 026248378b change primitive names back to %string_safe_set 2016-12-14 13:20:12 +00:00
Alain Frisch 69263a9893 Option-returning variants of stdlib functions (#885)
Provide an xxx_opt alternative for functions raising Not_found
and many instances of Failure/Invalid_arg.

The only exception is the rarely used Buffer.add_substitute, where
the [Not_found] can really be interpreted as an error condition.

Most new functions are implemented directly (instead of wrapping the
raising version).  This is for performance reasons and also to avoid
destroying the stacktrace (if the function is used in an exception
handler).  One could instead implement the raising versions on top of
the new functions, but there might be a small penalty.
2016-11-07 16:11:35 +00:00
Hongbo Zhang 82d2375cc6 apply changes to stdlib and test suite 2016-08-07 11:19:26 -04:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Jérémie Dimino 62b89a3a5c Replace uses of "noalloc" by [@@noalloc]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16455 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:22 +00:00
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +00:00
Gabriel Scherer 6d3318df9f I forgot about {Bytes,String}Labels.mapi; thanks Alain!
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15091 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-16 17:48:45 +00:00
Alain Frisch 68fe1ebd5a Use labeled arguments. (Cherry-picked from commit 15031 on 4.02).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15032 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-28 16:14:44 +00:00
Alain Frisch aeead32662 #6500: add String.init, Bytes.init, Labels couterparts, Stream.of_byte. (Cherry-picked from 15029 on 4.02.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15030 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-28 13:29:50 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez f95e7f4a59 uniformization of the warnings at the head of the hidden sections of the .mli
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12243 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-14 16:03:15 +00:00
Damien Doligez 0ed38a9fb1 bumped version to 4.00.0 (per Xavier's decision)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12212 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-08 22:27:57 +00:00
Damien Doligez 6c24f4f90b merge version 3.12 from 3.12.1 to r12205
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12210 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-08 19:52:03 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Alain Frisch f537ba28b0 Adding String.iteri.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10762 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-11-05 08:15:36 +00:00
Jacques Garrigue 60710728de sync comments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7805 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-01-22 08:06:09 +00:00
Xavier Leroy 63c1789b5e Fusion des modifs faites sur la branche release jusqu'a la release 3.08.0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-07-13 12:25:21 +00:00
Damien Doligez aa46693dc5 depollution (PR#1914, PR#1956)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6023 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-12-16 18:09:44 +00:00
Xavier Leroy 7501784c80 MAJ en-tetes pour mentionner la 'special exception' sur la LGPL
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-12-07 13:41:02 +00:00