Commit Graph

36 Commits (1cd6e4451f04af4871675d0eecd48b3bac262b67)

Author SHA1 Message Date
Gabriel Scherer 1cd6e4451f Map.filter_map and Set.filter_map 2020-03-31 15:01:41 +02:00
Gabriel Scherer 071bae4c5f typing/oprint: [minor] improve printing of empty signatures 2019-09-03 11:44:21 +02:00
Leo White f7fd84f877 Add tests 2018-11-21 03:39:34 -05:00
Armaël Guéneau 48f806a662 Update tests 2018-10-19 23:38:25 +02:00
Nicolás Ojeda Bär b7cb63bc34 Fix typing-modules/aliases test 2018-08-13 10:18:51 +02:00
Armaël Guéneau 0ccb589798 Refactor [Location.print_loc]; use it in [highlight_dumb] and expect_test.ml 2018-07-25 11:52:23 +02:00
Leo White 3c5d6120a3 Make all aliases absent in module type of 2018-05-01 11:38:22 +01:00
Leo White fd7d455cd8 Add test showing problem with module type of 2018-05-01 11:07:28 +01:00
Leo White 896bcd10c7 Don't remove aliases in module type of 2018-03-22 15:46:32 +00: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
Leo White c51c2f941b Add test 2018-03-02 14:29:47 +00:00
Gabriel Scherer 91dff3230a expect-style tests: include the code at the location of error messages
(joint work with Armaël Guéneau)
2017-12-12 15:35:02 +01:00
Sébastien Hinderer b95315d1ab Migrate typing-modules tests to ocamltest 2017-12-08 19:16:56 +01:00
Gabriel de Perthuis bf4b142586 [Stdlib] Implement find_first, find_last for maps and sets (#869)
Finds the first/last binding where the key satisfies a monotonic
predicate.

Addresses #665, supersedes #868.
Thanks @alainfrisch for the idea and most of the implementation.
2016-11-12 22:47:46 +01: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
Leo White caadb9de8a Allow more module aliases in strengthening 2016-07-28 10:13:32 +01:00
Jacques Garrigue 87098044bb switch typing-misc and typing-modules to Makefile.expect 2016-06-13 14:09:23 +09: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
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Jacques Garrigue 979fe8b8ad Do not add absolute paths for information added to
the local environment in Env.components_of_module_make.
Fixes the bug reported by Mark Shinwell on caml-devel,
on 2014-04-23. This bug was related to module aliases.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14674 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 09:09:08 +00:00
Jacques Garrigue 82e2f35a14 Fix PR#6376
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-21 10:38:04 +00:00
Damien Doligez 7303ac34ca fix some of the whitespace problems in the source
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 10:17:02 +00:00
Jacques Garrigue fb74ef5e51 Fix PR#6365
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14565 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-09 04:01:26 +00:00
Jacques Garrigue 65b1193406 Fix PR#6307
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14451 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10 02:54:02 +00:00
Jacques Garrigue c20af454f3 Fix PR#6240
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14301 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-18 06:44:13 +00:00
Jacques Garrigue b4f8172430 also generate module aliases when using include
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14295 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-15 15:19:25 +00:00
Jacques Garrigue 199ace8189 applicative functor application
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14218 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-08 07:21:41 +00:00
Jacques Garrigue c74f7c60e2 fix path comparison. still a problem with FCMod in Core.Binable
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14208 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-02 13:23:48 +00:00
Jacques Garrigue 251289a3a1 fix exn_rebind: camlp4 compiles again
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14207 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-02 08:34:01 +00:00
Jacques Garrigue eda1266114 passes the testsuite!
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14202 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 15:54:02 +00:00
Jacques Garrigue 5f68db9cf0 Merge trunk at revision 14200. Now everything works except private types
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14201 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 13:54:59 +00:00
Jacques Garrigue 4c5e9bbe6b mostly works, but:
* a strange bug in open
* spurious bindings in the lambda code


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14200 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 11:35:15 +00:00
Jacques Garrigue e686ed503a now works with nested structures; still problems inside functors
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14199 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 03:18:47 +00:00
Jacques Garrigue 9ddb346f54 do not alias functor parameters + some problems with coercions not fixed yet
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14198 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 02:10:21 +00:00
Jacques Garrigue e0cdc52ba0 module translation + bad functor example
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14197 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-29 11:49:07 +00:00
Jacques Garrigue 97899f37ca Support module aliases.
Namely, you can write "module L = List" in signatures,
and avoid have the compiler use directly List when you write L.
See examples in testsuite/tests/typing-modules/aliases.ml


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14196 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-29 07:22:34 +00:00