Commit Graph

2194 Commits (f71a41daafc7a809cdac5064e326fcc7507d2aa9)

Author SHA1 Message Date
Mehdi Bouaziz 6ab6052e15
[hashtbl] Restore ongoing traversal status after filter_map_inplace (#8746) 2020-10-12 15:12:09 +02:00
Xavier Leroy 86c8a98f3c
Merge pull request #9948 from nojb/remove_spacetime
The Spacetime memory profiler is not going to be supported in Multicore OCaml, and  is already broken by some of the related changes in OCaml 4.12.  The core development team decided to remove Spacetime support from OCaml 4.12.
2020-10-09 14:43:23 +02:00
Damien Doligez 0069123c61
clean up and fix GC message 0x1 (#9949) 2020-10-09 12:02:00 +02:00
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Xavier Leroy af48d9fe8f
Add a naked pointers dynamic checker (#9956)
This is selected at configure-time, option --enable-naked-pointers-checker.

The major GC warns when it detects out-of-heap pointers that could cause the no-naked-pointers runtime system to crash.

This is supported on x86-64 only, but on all ports (Unix and Windows).

Added tests involving naked pointers in tests/runtime-naked-pointers

Co-authored-by: KC Sivaramakrishnan <kc@kcsrk.info>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Co-authored-by: Enguerrand Decorne <decorne.en@gmail.com>
2020-10-05 14:44: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
Thomas Refis 7d9e60daa4
dune: build stdlib without injectivity annotations (#9932) 2020-09-22 10:31:48 +02:00
Gabriel Scherer 0a1ed638c4
Merge pull request #9918 from OCamlPro-Coquera/trunk
Stdlib.Format: missing `since` annotation for formatter_out_functions
2020-09-15 11:54:36 +02:00
Florian Angeletti d0e983e2aa
Merge pull request #9745 from johnwhitington/trunk
Unify labeled and unlabeled Standard Library module interfaces
2020-09-15 11:07:25 +02:00
Albin Coquereau dedbb708ce move since tag to type definition 2020-09-15 10:33:11 +02:00
Albin Coquereau 0da6ca1f11 Add a comment that out_indent is part of formatter_out_functions since ocaml 4.06.0 2020-09-15 09:58:20 +02:00
Florian Angeletti bc4d260de7
Merge pull request #9865 from raphael-proust/pp_print_seq
Stdlib.Format: add pp_print_seq
2020-09-14 16:52:11 +02:00
John Whitington 2d217e7c44 assoc -> assoc_opt 2020-09-11 20:07:44 +01:00
John Whitington bcc16f692b Fix two little errors 2020-09-11 18:10:12 +01:00
John Whitington a866c6d07f Fix reference to tools/unlabel 2020-09-11 14:39:12 +01:00
John Whitington c3f6cd7ff7 Merge remote-tracking branch 'upstream/trunk' into trunk 2020-09-11 14:14:38 +01:00
John Whitington 69c59b172d Take account of GPR#9668 2020-09-10 21:01:02 +01:00
John Whitington fc101ae849 Rename tools/unlabel --> tools/sync_stdlib_docs 2020-09-10 19:17:43 +01:00
John Whitington 5fd8236343 Fix comment regarding NaN in Array.sort 2020-09-10 18:10:29 +01:00
John Whitington 99645f901b Adds readme to stdlib/templates 2020-09-10 18:08:00 +01:00
Gabriel Scherer 03839754f4
List.equal, List.compare (#9668)
`List.equal f foo bar` is nicer than
`List.length foo = List.length bar && List.for_all2 f foo bar`.

Note: with List.compare there is a risk of users having opened the
List module, and then using 'compare' from the stdlib unqualified. For
example:

    List.(sort compare foo bar)

Such code will break (type error), and has to be fixed by using
Stdlib.compare. Stdlib is available since OCaml 4.07; people wishing
to support both 4.12 and older releases would have to avoid opening
List, or rebind 'compare' locally.
2020-09-09 20:01:04 +02:00
Xavier Leroy 1b48b5aa3c
Merge pull request #9872 from xavierleroy/seek-text-channels
Revised {in,out}_channel_length and seek_in for channels in text mode
2020-09-08 09:52:22 +02:00
Xavier Leroy 83c762974b Document the issue with pos_{in,out} and files opened in text mode
Add changes for 9872
2020-09-08 09:51:35 +02:00
David Allsopp 558424dcbb
Merge pull request #9851 from yallop/obj-tag-noalloc
Mark Obj.tag [@@noalloc]
2020-09-07 14:34:04 +01:00
Jeremy Yallop 1a8aa5428e Add partition_map to ListLabels. 2020-09-03 22:23:00 +02:00
Gabriel Scherer ca6f3ee057 List.partition_map : (a -> (b, c) Either.t) -> a list -> b list * c list 2020-09-02 13:59:53 +02:00
Gabriel Scherer 25e59d63d8 Add `'a Either.t = Left of 'a | Right of 'b`
```ocaml
val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : left:('a1 -> 'a2) -> right:('b1 -> 'b2) -> ('a1, 'b1) t -> ('a2, 'b2) t
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'c
val equal :
  left:('a -> 'a -> bool) -> right:('b -> 'b -> bool) ->
  ('a, 'b) t -> ('a, 'b) t -> bool
val compare :
  left:('a -> 'a -> int) -> right:('b -> 'b -> int) ->
  ('a, 'b) t -> ('a, 'b) t -> int
```

Unlike [result], no [either] type is made available in Stdlib,
one needs to access [Either.t] explicitly:

- This type is less common in typical OCaml codebases,
  which prefer domain-specific variant types whose constructors
  carry more meaning.
- Adding this to Stdlib would raise warnings in existing codebases
  that already use a constructor named Left or Right:
  + when opening a module that exports such a name,
    warning 45 is raised
  + adding a second constructor of the same name in scope kicks
    in the disambiguation mechanisms, and warning 41 may now
    be raised by existing code.

If the use becomes more common in the future we can always
revisit this choice.
2020-09-02 13:59:53 +02:00
Raphaël Proust bed23dfbbc Stdlib.Format: add pp_print_seq 2020-09-01 17:51:34 +02:00
Jeremy Yallop 491cc88b33 Mark Obj.tag [@@noalloc] 2020-08-21 10:29:31 +01:00
John Whitington 7bb80d434e "final" fixes 2020-08-06 14:18:18 +01:00
John Whitington af6ad84d6d Restore tilde-removal, other little fixes 2020-08-05 17:39:59 +01:00
John Whitington 5e5423b1f2 Compflags @since removal for .cmti files for odoc 2020-08-05 16:36:37 +01:00
John Whitington 35cb3e550f Float.Array(Labels) generated by tools/unlabel 2020-08-05 15:39:33 +01:00
John Whitington d42970a989 @since modifications only happen on labeled files 2020-08-05 13:52:44 +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 13965773ed Tildes back in ~random parameter in Hashtbl.create 2020-08-03 13:01:33 +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 a5ed794b4c Check-typo and indenting all done 2020-07-31 14:24:50 +01:00
John Whitington 35a3470a9d Better indentation for moreLabels.mli patches 2020-07-31 12:38:45 +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 dd1f3789f2 Tilde removal in place. Now will put them back in. 2020-07-29 13:58:22 +01:00
John Whitington 28f624b919 check-typo fixes 2020-07-27 15:53:57 +01:00
John Whitington 902ca08055 Fix tools/unlabel to deal with Hashtbl injectivity 2020-07-27 15:44:35 +01:00
John Whitington e5e7b9591a Restore docstring variable brackets 2020-07-27 14:42:30 +01:00