We just put out a new release of Base, version v0.11, and it is available in opam now. (Along with the rest of Jane Street’s open source libraries, which have all been released, with the same version number.)
Base hasn’t yet reached it’s 1.0 release, but we hope to get there in the next six months. One of our reasons for delaying the 1.0 release is that we intend for the 1.0 release to prioritize stability of the APIs, and there are a few changes that we need to make before then. You can see some of the remaining changes we want to make before declaring 1.0 on our Roadmap.
As of our 0.11 release, we’ve hit a majority of the issues on our roadmap, but there are still a few to go. But if stability is your top priority, you might want to wait for 1.0 before adopting Base.
You can find the Base changelog on GitHub, but here’s a version below, highlighting some of the breaking changes.
v0.11
Breaking Changes
-
Make
~compare
a required argument toList.dedup_and_sort
,List.dedup
,List.find_a_dup
,List.contains_dup
, andList.find_all_dups
. -
Deprecated
Not_found
, people who need it can useCaml.Not_found
, but its use isn’t recommended. -
Removed unnecessary unit argument from
Hashtbl.create
. -
Removed
Hashable.t
constructors fromHashtbl
andHash_set
, instead favoring the first-class module constructors. -
Removed
Container
operations fromEither.First
andEither.Second
. -
Changed the type of
fold_until
in theContainer
interfaces. Rather than returning aFinished_or_stopped_early.t
(which has also been removed), the function now takes afinish
function that will be applied the result iff
never returned aStop _
. -
Removed the
String_dict
module. -
Removed
List.exn_if_dup
. It is still available in core_kernel. -
Removed “normalized” index operation
List.slice
. It is still available in core_kernel. -
Remove “normalized” index operations from
Array
, which inclucedArray.normalize
,Array.slice
,Array.nget
andArray.nset
. These operations are still available in core_kernel. -
Remove “normalized” index operations from
String
, which inclucedString.normalize
,String.slice
,String.nget
andString.nset
. These operations are still available in core_kernel. -
Removed approximate float comparison operations, e.g.,
(<=.)
Removal of deprecated functionality
- Removed deprecated operations from
Hashtbl
.
Deprecations
-
Deprecated
all_ignore
in theMonad
andApplicative
interfaces in favor ofall_unit
. -
Deprecated
Array.replace_all
in favor ofArray.map_inplace
, which is the standard name for that sort of operation within Base.
Documentation changes
-
Document that
Array.find_exn
,Array.find_map_exn
, andArray.findi_exn
may throwCaml.Not_found
orNot_found_s
. -
Document that
List.find_exn
, andList.find_map_exn
may throwCaml.Not_found
orNot_found_s
. -
Document that
List.find_exn
may throwCaml.Not_found
orNot_found_s
. -
Document that
String.lsplit2_exn
, andString.rsplit2_exn
may throwCaml.Not_found
orNot_found_s
. -
Document that
List.find_exn
, andList.find_map_exn
may throwCaml.Not_found
orNot_found_s
.
Other enhancements
-
Added
Sequence.group
, similar toList.group
. -
Reimplemented
String.Caseless.compare
so that it does not allocate. -
Added the
Sexp.Not_found_s
exception which will replaceCaml.Not_found
as the default exception in a future release. -
Added
Sys.argv
. -
Added a infix exponentation operator for int.
-
Added a
Formatter
module to reexport theFormat.formatter
type and updated the deprecation message forFormat
. -
Added
Sys.backend_type
. -
Added
String.is_substring_at string ~pos ~substring
. Used it as back-end foris_suffix
andis_prefix
. -
Added
Uniform_array
module that is just like anArray
except guarantees that the representation array is not tagged withDouble_array_tag
, the tag for float arrays. -
Added
Option_array
module that allows for a compact representation of'a option array
, which avoids allocating heap objects representingSome a
. -
Moved all remaining
Replace_polymorphic_compare
submodules from Base types and consolidated them in one place withinImport0
. -
Document that
Hashtbl.find_exn
may throwCaml.Not_found
orNot_found_s
. -
Added a
Poly
submodule toMap
andSet
that exposes constructors that use polymorphic compare. -
Added a
Queue
module that is backed by anOption_array
for efficient and (non-allocating) implementations of most operations. -
Added missing conversions between
Int63
and other integer types, specifically, the versions that return options. -
Added truncating versions of integer conversions, with a suffix of
_trunc
. These allow fast conversions via bit arithmetic without any conditional failure; excess bits beyond the width of the output type are simply dropped.