Skip to content

Commit c8f6acf

Browse files
committed
v0.12-preview.120.18+252
1 parent fe80ab3 commit c8f6acf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+319
-376
lines changed

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2016--2018 Jane Street Group, LLC <[email protected]>
3+
Copyright (c) 2016--2019 Jane Street Group, LLC <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)
22

3-
# Default rule
43
default:
5-
jbuilder build @install
4+
dune build
65

76
install:
8-
jbuilder install $(INSTALL_ARGS)
7+
dune install $(INSTALL_ARGS)
98

109
uninstall:
11-
jbuilder uninstall $(INSTALL_ARGS)
10+
dune uninstall $(INSTALL_ARGS)
1211

1312
reinstall: uninstall install
1413

1514
clean:
16-
rm -rf _build
15+
dune clean
1716

1817
.PHONY: default install uninstall reinstall clean

README.org

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $ opam install base
2020
#+end_src
2121

2222
Base has no runtime dependencies and is fast to build. Its sole build
23-
dependency is [[https://github.com/janestreet/jbuilder][jbuilder]], which itself requires nothing more than the
23+
dependency is [[https://github.com/ocaml/dune][dune]], which itself requires nothing more than the
2424
compiler.
2525

2626
** Using the OCaml standard library with Base
@@ -159,8 +159,8 @@ The Base specific coding rules are checked by =ppx_base_lint=, in the
159159
=lint= subfolder. The indentation rules are checked by a wrapper around
160160
=ocp-indent= and the coding style rules are checked by =ppx_js_style=.
161161

162-
These checks are currently not run by =jbuilder=, but it will soon get
163-
a =-dev= flag to run them automatically.
162+
These checks are currently not run by =dune=, but it will soon get a
163+
=-dev= flag to run them automatically.
164164

165165
** Roadmap
166166

ROADMAP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
and to maintain it on an ongoing basis. See `bench/bench_int.ml` for
9292
examples.
9393

94-
- [ ] Optimize `Lazy.compare` by performing a `phys_equal` check before
94+
- [X] Optimize `Lazy.compare` by performing a `phys_equal` check before
9595
forcing the lazy value. Note that this will also change the semantics of
9696
`compare` and should be documented and rolled out with care.
9797

base.opam

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
opam-version: "1.2"
1+
opam-version: "2.0"
22
maintainer: "[email protected]"
33
authors: ["Jane Street Group, LLC <[email protected]>"]
44
homepage: "https://github.com/janestreet/base"
55
bug-reports: "https://github.com/janestreet/base/issues"
66
dev-repo: "git+https://github.com/janestreet/base.git"
7+
doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/base/index.html"
78
license: "MIT"
89
build: [
9-
["jbuilder" "build" "-p" name "-j" jobs]
10+
["dune" "build" "-p" name "-j" jobs]
1011
]
1112
depends: [
13+
"ocaml" {>= "4.04.2"}
1214
"sexplib0"
13-
"jbuilder" {build & >= "1.0+beta18.1"}
15+
"dune" {build & >= "1.5.1"}
1416
]
1517
depopts: [
1618
"base-native-int63"
1719
]
18-
available: [ ocaml-version >= "4.04.2" ]
19-
descr: "
20-
Full standard library replacement for OCaml
21-
20+
synopsis: "Full standard library replacement for OCaml"
21+
description: "
2222
Full standard library replacement for OCaml
2323

2424
Base is a complete and portable alternative to the OCaml standard

compiler-stdlib/gen/dune

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(executables (names gen)
2+
(libraries compiler-libs.common compiler-libs.bytecomp)
3+
(preprocess no_preprocessing))

compiler-stdlib/gen/jbuild

-7
This file was deleted.

compiler-stdlib/src/dune

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(library (name caml) (public_name base.caml) (preprocess no_preprocessing))
2+
3+
(rule (targets caml.ml) (deps (:first_dep ../gen/gen.exe))
4+
(action (run %{first_dep} -ocaml-where %{ocaml_where} -o %{targets})))

compiler-stdlib/src/jbuild

-11
This file was deleted.

dune-project

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(lang dune 1.5)

generate/dune

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(executables (names generate_pow_overflow_bounds) (libraries num)
2+
(preprocess no_preprocessing))

generate/jbuild

-7
This file was deleted.

lint/dune

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(library (name ppx_base_lint) (kind ppx_rewriter)
2+
(libraries compiler-libs.common base ppxlib)
3+
(preprocess no_preprocessing))

lint/jbuild

-8
This file was deleted.

md5/src/dune

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(library (name md5_lib) (public_name base.md5) (preprocess no_preprocessing)
2+
(libraries) (js_of_ocaml (javascript_files)))

md5/src/jbuild

-12
This file was deleted.

shadow-stdlib/gen/dune

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(executables (names gen) (libraries str compiler-libs.common caml)
2+
(link_flags -linkall) (preprocess no_preprocessing))
3+
4+
(ocamllex mapper)

shadow-stdlib/gen/jbuild

-10
This file was deleted.

shadow-stdlib/gen/mapper.mll

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let deprecated_msg what =
1515
sprintf
1616
"[@@deprecated \"\\\n\
1717
[2016-09] this element comes from the stdlib distributed with OCaml.\n\
18-
Refering to the stdlib directly is discouraged by Base. You should either\n\
18+
Referring to the stdlib directly is discouraged by Base. You should either\n\
1919
use the equivalent functionality offered by Base, or if you really want to\n\
2020
refer to the stdlib, use Caml.%s instead\"]"
2121
what

shadow-stdlib/src/dune

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(library (name shadow_stdlib) (public_name base.shadow_stdlib)
2+
(libraries caml) (preprocess no_preprocessing))
3+
4+
(rule (targets shadow_stdlib.mli)
5+
(deps (:first_dep ../gen/gen.exe)
6+
../../compiler-stdlib/src/.caml.objs/caml.cmi)
7+
(action
8+
(run %{first_dep} -caml-cmi ../../compiler-stdlib/src/.caml.objs/caml.cmi
9+
-o %{targets})))

shadow-stdlib/src/jbuild

-17
This file was deleted.

src/am_testing.c

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include <caml/mlvalues.h>
22

3+
/* The default [Base_am_testing] value is [false]. [ppx_inline_test] overrides
4+
the default by linking against an implementation of [Base_am_testing] that
5+
returns [true]. */
36
CAMLprim CAMLweakdef value Base_am_testing()
47
{
58
return Val_false;

src/am_testing.h

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef BASE_AM_TESTING_H
2+
#define BASE_AM_TESTING_H
3+
#include <caml/mlvalues.h>
4+
5+
CAMLprim value Base_am_testing ();
6+
7+
static inline int am_testing () {
8+
return Bool_val (Base_am_testing ());
9+
}
10+
11+
#endif

src/applicative.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module Make_args' (X : S2) = struct
9898

9999
type ('f, 'r, 'e) t_ = { applyN : ('f, 'e) X.t -> ('r, 'e) X.t }
100100

101-
let nil = { applyN = fun x -> x }
101+
let nil = { applyN = Fn.id }
102102

103103
let cons arg t = { applyN = fun d -> t.applyN (apply d arg) }
104104

src/array.ml

+4-6
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ module Sort = struct
6666
(* http://en.wikipedia.org/wiki/Insertion_sort *)
6767
module Insertion_sort : Sort = struct
6868
let sort arr ~compare ~left ~right =
69-
let insert pos v =
69+
(* loop invariant:
70+
[arr] is sorted from [left] to [pos - 1], inclusive *)
71+
for pos = left + 1 to right do
7072
(* loop invariants:
7173
1. the subarray arr[left .. i-1] is sorted
7274
2. the subarray arr[i+1 .. pos] is sorted and contains only elements > v
7375
3. arr[i] may be thought of as containing v *)
76+
let v = get arr pos in
7477
let rec loop i =
7578
let i_next = i - 1 in
7679
if i_next >= left && compare (get arr i_next) v > 0 then begin
@@ -81,11 +84,6 @@ module Sort = struct
8184
in
8285
let final_pos = loop pos in
8386
set arr final_pos v
84-
in
85-
(* loop invariant:
86-
arr is sorted from left to i-1, inclusive *)
87-
for i = left + 1 to right do
88-
insert i (get arr i)
8987
done
9088
;;
9189
end

0 commit comments

Comments
 (0)