Batteries_uni is dead. Always
open Batteries (unless accessing
BatFoo directly to minimize executable size).
- All syntax extensions removed (pa_comprehension, estring, pa_lazylist). These can be put in an external project for continued usage. Max Mouratov has packaged pa_comprehension.
- BatPrint and related printing functionality that depended on estring is removed. Use
print functions in each module to build printers and
%a to include in printf.
- The inconsistently available
sprint functions are removed in favor of
BatIO.to_string, which turns any printing function to have string output.
Array.make_compare are renamed to
Buffer.output_buffer now makes a
string IO.output backed by a buffer object; use
Buffer.print to print buffers.
- Comparison operators for numeric types moved to
Compare submodule so that opening Int64 doesn't override
(=). Arithmetic operators for numeric types copied into
Infix submodule so that it can be locally opened to provide easy access.
List.unique_eq replaced by
unique_hash that uses a hash table to make finding identical members faster.
Map.filter repaced by
filteri is now
filter, for compatibility with base stdlib.
- The default
('a, 'b) Map.t and
'a Set.t no longer have a customizable comparison function; to get the old
Extlib.PMap behavior, use
- Default instantiations of Map and Set are no longer available. (i.e.
IStringMap, etc.) These may be added to
Int, etc. in 2.1.
Map.exists now uses a two-argument predicate that takes both key and value, as previous
Random.full_range renamed to
String.split,rsplit,nsplit now use a labeled argument for their splitting string to avoid reversing the splitting string and the string to be split.
File.finally properly moved to
opt renamed to
- To reduce inter-module dependencies, removed printing functions
IO.printf moved to
write_*s functions for printing an enum of some value removed, as
Enum.iter (Foo.print oc) works well.
LazyList.iteri argument function must return unit, not
BatOptParse removed; use
PMap moved inside
RefList.add_sort, sort parameter
?cmp now mandatory.
Std removed, all functions (that still exist) are in
Monad moved into
Pair removed, now provided by
PathGen moved into Incubator, in preparation for interface changes, should return stably before 3.0.
Result rewritten with lots more useful helper functions,
- Use of suffix
n in Tuple made consistent with other usage:
foo takes one function for each component,
foon works on homogenous tuples and takes one function total.
Tuple.prj* renamed to
Vect.sub argument order made consistent with
IMap now takes an equality predicate on construction instead of on each add.
IMap.union renamed to
merge to correspond with
union now much simpler interface to simply join maps, only needing to resolve value of conflicting keys.
UTF8 provided without dependency on Camomile.
lowercase removed from
- Function compostion operators changed: @@ for apply, % for compose, |> for revapply (unchanged), %> for rev-compose
&&&; use Tuple functions instead
RMutex modules moved to
BatteriesThread module, open this in addition to
Batteries if you're using them.
- Pervasive use of
equal for constructing comparison and equality tests combinatorially, like
Array gains new functions
Hashtbl.print gets new optional argument
~kvsep to set the text used to separate keys and values.
List gains new functions
transpose to transpose a rectangular list of lists.
Random.multi_choice allows the choosing of
n random values from an enumeration.
Set.sym_diff function to compute the symmetric difference between two sets.
Set.disjoint can quickly identify if two sets have no common elements without computing their intersection.
String.nreplace added to search/replace globally
Enum.fsum, with Kahan summing to reduce error when adding a list of floats
Enum.get_exn to get the head of the enum and raise an exception if it is empty.
Enum.find_map to get the first non-
None result of a function on the input enum.
File.open_temporary* have additional paremeter ?temp_dir to set the directory of the file
filter added, also
(|?) as a flipped synonym for
Ref.toggle added to invert a bool ref
Ref.oset,oget_exn added to make
'a option ref easier to use.
- New module
- New module
MultiMap added to specicialize
MultiPMap for just
Seq gets an
Infix module that provides the functions that
- Float constants: e, log2e, log10e, ln2, ln10, pi2, pi4, invpi, invpi2, sqrtpi2, sqrt2, invsqrt2
Float.approx_equal to compare floats with epsilon precision
Int.min, max for performance,
mid for correct computation of midpoint of two numbers wrt. overflow, and
popcount/popcount_sparse for counting set bits in an int.
- New incubator modules (unstable interface):
BatLog, a new logging module,
BatSubstring, a substring class that needs to be changed to OCaml style, and
BatBounded, for normalizing values within a bounded range.
dump any value to a channel
- `input_lines/chars/list/all' to read in a channel into a string enum/char enum/string list/string
output_file/input_file to read or write files as strings; very simple interface
neg2 to negate predicate functions of one or two parameters
forever to run a function until it raises an exception
ignore_exceptions as ignore, but eats exceptions too
verify_arg a helper function to raise
Invalid_arg if a condition is not met.
wrap made available in