Array.fold
- renamed fromArray.foldLeft
Array.reverse
- Now works in-place:
- Previously:
val reverse : 'a array -> 'a array
- Currently:
val reverse : 'a t -> unit
Array.sum
- now supports int
and float
- Previously:
val sum : int array -> int
- Currently:
val sum : 'a t -> (module TableclothContainer.Sum with type t = 'a) -> 'a
Array.join
Array.clone
Array.last
Array.sort
Array.count
Array.includes
Array.minimum
Array.maximum
Array.extent
Array.filterMap
Array.flatten
Array.zip
Array.partition
Array.splitAt
Array.splitWhen
Array.unzip
Array.forEachWithIndex
Array.values
Array.chunksOf
Array.groupBy
Array.equal
Array.compare
Array.empty
Bool.fromInt
Bool.fromString
( && )
( || )
Bool.xor
Bool.not
Bool.toString
Bool.toInt
Bool.equal
Bool.compare
Char.equal
Char.compare
The functions now use a new type Radians
:
Float.fromPolar
Float.from_polar
Float.cos
Float.acos
Float.sin
Float.asin
Float.tan
Float.atan
Float.atan2
These functions now return Radians
:
Float.degrees
Float.radians
Float.turns
Float.toPolar
Float.to_polar
- type
Radians
Float.epsilon
Float.largestValue
Float.smallestValue
Float.maximumSafeInteger
Float.minimumSafeInteger
Float.fromString
Float.isInteger
Float.isSafeInteger
Float.toString
Float.equal
Float.compare
Fun.curry
- renamed fromTuple2.curry
Fun.uncurry
- renamed fromTuple2.uncurry
Fun.curry3
- renamed fromTuple3.curry
Fun.uncurry3
- renamed fromTuple3.uncurry
Fun.negate
Fun.forever
Fun.times
( /. )
- floating point division; renamed from( // )
mod
equal
compare
List.initial
- renamed fromList.init
List.sort
- renamed fromList.sortWith
List.includes
- renamed fromList.member
List.fold
- renamed fromList.foldLeft
List.partition
- renamed fromList.span
List.forEach
- renamed fromList.iter
List.join
- renamed fromList.concat
List.mapWithIndex
- renamed fromList.indexedMap
,List.mapi
List.sum
- renamed fromList.floatSum
, see change below
List.repeat
- slight signature change
- Previously:
val repeat : count:int -> 'a -> 'a list
- Currently:
val repeat : 'a -> times:int -> 'a t
List.includes
- takes explicit equal
function; renamed from List.concat
- Previously:
val member : value:'a -> 'a list -> bool
- Currently:
val includes : 'a t -> 'a -> equal:('a -> 'a -> bool) -> bool
List.minimum
- takes explicit compare
function
- Previously:
val minimum : 'comparable list -> 'comparable option
- Currently:
val minimum : 'a t -> compare:('a -> 'a -> int) -> 'a option
List.maximum
- takes explicit compare
function
- Previously:
val maximum : 'comparable list -> 'comparable option
- Currently:
val maximum : 'a t -> compare:('a -> 'a -> int) -> 'a option
List.sum
- takes module type argument; now includes float
- Previously:
val sum : int list -> int
- Currently:
val sum : 'a t -> (module TableclothContainer.Sum with type t = 'a) -> 'a
List.intersperse
- sep
now a named parameter
- Previously:
val intersperse : 'a -> 'a list -> 'a list
- Currently:
val intersperse : 'a t -> sep:'a -> 'a t
List.join
- renamed from List.concat
, sep
is now a named parameter
- Previously:
val concat : string list -> string
- Currently:
val join : string t -> sep:string -> string
List.empty
List.singleton
List.range
List.updateAt
List.count
List.extent
List.filterWithIndex
List.flatMap
List.flatten
List.zip
List.map3
List.unzip
List.forEachWithIndex
List.chunksOf
List.groupBy
List.toArray
List.equal
List.compare
List.getBy
- was the same asList.find
List.elemIndex
- useList.findIndex
instead
Option.unwrap
- renamed fromOption.withDefault
Option.unwrapUnsafe
- renamed fromOption.getExn
Option.and_
Option.both
Option.flatten
Option.map2
Option.isNone
Option.tap
Option.toArray
Option.equal
Option.compare
( |? )
-Option.get
( >>| )
-Option.map
( >>| )
-Option.andThen
Result.ok
- renamed fromResult.succeed
Result.error
- renamed fromResult.fail
Result.unwrap
- renamed fromResult.withDefault
type (‘ok, ‘error) t
- changed fromtype (‘err, ‘ok) t
Result.fromOption
- Previously:
val fromOption : error:'err -> 'ok option -> ('err, 'ok) t
- Currently:
val fromOption : 'ok option -> error:'error -> ('ok, 'error) t
Result.map
- Previously:
val map : f:('ok -> 'value) -> ('err, 'ok) t -> ('err, 'value) t
- Currently:
val map : ('a, 'error) t -> f:('a -> 'b) -> ('b, 'error) t
Result.andThen
- Previously:
val andThen : f:('ok -> ('err, 'value) t) -> ('err, 'ok) t -> ('err, 'value) t
- Currently:
val andThen : ('a, 'error) t -> f:('a -> ('b, 'error) t) -> ('b, 'error) t
Result.toOption
- Previously:
val toOption : ('err, 'ok) t -> 'ok option
- Currently:
val toOption : ('ok, \_) t -> 'ok option
Result.combine
- Previously:
val combine : ('x, 'a) t list -> ('x, 'a list) t
- Currently:
val combine : ('ok, 'error) result list -> ('ok list, 'error) result
Result.attempt
Result.isOk
Result.is_ok
Result.is_error
Result.and_
Result.or_
Result.orElse
Result.both
Result.flatten
Result.unwrapLazy
Result.unwrapUnsafe
Result.unwrap_unsafe
Result.unwrapError
Result.unwrap_error
Result.values
Result.mapError
Result.map_error
Result.tap
Result.equal
Result.compare
( |? )
- operator version ofResult.unwrap
( >>= )
- operator version ofResult.andThen
( >>| )
- operator version ofResult.map
Result.pp
Renamed from IntDict and StrDict
-
All functions are part of the
Map
module, instead ofIntDict
andStrDict
. -
These functions now take a module parameter to pass the comparator. You can use the versions in the
Map.Poly
,Map.Int
orMap.String
modules which have an implicit comparator: -
Map.empty
-
Map.singleton
-
Map.fromArray
-
Map.fromList
Map.add
- renamed fromIntDict.insert
,StrDict.insert
Map.Of()
Map.empty
Map.singleton
Map.fromArray
Map.fromList
( .?{}<- )
-Map.add
Map.remove
( .?{} )
-Map.get
Map.isEmpty
Map.length
Map.any
Map.all
Map.find
Map.includes
Map.minimum
Map.maximum
Map.extent
Map.mapWithIndex
Map.filter
Map.partition
Map.fold
Map.forEach
Map.forEachWithIndex
Map.values
Map.toArray
Map.Poly.empty
Map.Poly.singleton
Map.Poly.fromArray
Map.Poly.fromList
Map.Int.singleton
Map.Int.fromArray
Map.String.singleton
Map.String.fromArray
IntDict.toString
IntDict.pp
StrDict.toString
StrDict.pp
Renamed from IntSet and StrSet.
- All functions are part of the
Set
module, instead ofIntSet
andStrSet
. - These functions now take a module parameter to pass the comparator. You can use the
versions in the
Set.Poly
,Set.Int
orSet.String
modules which have an implicit comparator:
Set.add
- renamed fromIntSet.set
,StrSet.set
Set.includes
- renamed fromIntSet.member
,StrSet.member
,IntSet.has
,StrSet.has
Set.difference
- renamed fromIntSet.diff
,StrSet.diff
Set.fromList
- renamed fromIntSet.ofList
,StrSet.ofList
type (‘a, ‘id)
type identity
Set.empty
Set.singleton
Set.fromArray
Set.length
Set.find
Set.any
Set.all
Set.intersection
Set.filter
Set.partition
Set.fold
Set.forEach
Set.toArray
Set.toList
Set.Poly.empty
Set.Poly.singleton
Set.Poly.fromArray
Set.Poly.fromList
Set.Int.empty
Set.Int.singleton
Set.Int.fromArray
Set.Int.fromList
Set.String.empty
Set.String.singleton
Set.String.fromArray
Set.String.fromList
IntSet.pp
StrSet.pp
String.toLowercase
- renamed fromString.toLower
String.toUppercase
- renamed fromString.toUpper
String.fromArray
String.initialize
String.get
String.getAt
( .?[] )
-String.getAt
String.isEmpty
String.includes
String.indexOf
String.indexOfRight
String.trimLeft
String.trimRight
String.padLeft
String.padRight
String.forEach
String.fold
String.toArray
String.toList
String.equal
String.compare
Tuple2.make
- renamed fromTuple2.create
type ('a, 'b) t = 'a * 'b
Tuple2.fromArray
Tuple2.fromList
Tuple2.equal
Tuple2.compare
Tuple3.make
- renamed fromTuple3.create
Tuple3.initial
- renamed fromTuple3.init
type ('a, 'b, 'c) t = 'a * 'b * 'c
Tuple3.fromArray
Tuple3.fromList
Tuple3.toArray
Tuple3.equal
Tuple3.compare
Summary:
- new Fun modules
- new functions in List, Array, Int, Float, Option and Result
- support latest bs-platform (7.3.2)
- there is now a makefile with common commands
- code is all formatted with ocamlformat
Build:
- add a
Makefile
with common commands (#68, #69, @wpcarro) Makefile
improvements (#73, #82, #85, @dmnd, @Dean177, @joesiewert)- switch to
ocamlformat
(#70, @wpcarro) - expand CI coverage (#80, #84, @Dean177, @joesiewert)
- support latest bs-platform (#104 @Coobaha)
Documentation:
- fix typos (#50 @tcoopman, #51 @ostera)
- imrpove String docs (#52, @jdeisenberg)
- switch to OCaml documentation format only (#53, @jdeisenberg)
Fun:
- new module (@Dean177)
Massively expanded Int and Float (#47, @Dean177):
- All operators also get a named function equivalent
- The
clamp
,hypotenuse
andinRange
functions are introduced round
,floor
,ceiling
andtruncate
return afloat
instead of anint
withFloat.toInt
serving as the only way to convert to an integer.round
has been expanded to cover (most of) the many possible ways to go about rounding floating point numbers. The documentation for this one might be a little over the top, I wasn't sure about the clearest way to demonstrate the behaviour.logBase
becomeslog ~base:
min
,max
,mod
,sqrt
andabs
get non-abbreviated namesremainderBy
andmodBy
drop the 'By' and get a labelled argumentclamp
andinRange
can throw an exception if theupper
argument is less than thelower
argument.
Float:
- fix tests on OSX (#60, @kuy)
List:
- add
sliding
(#81, @Dean177) - add
repeat
(#90 @msvbg)
Array:
- fix signature of
flatMap
(#55, @figitaki) - add
findIndex
(#78, @Dean177) - add
swap
(#76, @Dean177) - add
sliding
(#81, @Dean177) - add
get
andset
(#74, @dmnd) - change
empty
to be a function (requirement in latest bs-platform) (#104 @Coobaha)
Option:
- add
getExn
(#65, dmnd)
Result:
- add
fromOption
(#66, wpcarro) - use
~f
inResult.map
(#115 @joefiorini)
String:
- remove deprecation warnings (#88 @msvbg)
Summary:
- significant documentation across entire codebase
- new functions in List, Tuple2, Result, Option, and String
- new modules: Tuple3, Char, Array (mutable arrays)
- remove Regex module
CircleCI:
- Add CI (#15, #19, @Dean177)
Toplevel functions:
- Add documentation (#16, @jdeisenberg)
Array:
- Add module (#14, #27, @j-m-hoffmann, @Dean177)
List:
- Add reverse (#9, @j-m-hoffmann)
- Add tests (#9, #13, #28, @j-m-hoffmann, @jdeisenberg)
- Convert rescript files to use Belt more (#9, #11, #12 @j-m-hoffmann)
- Add minimum (#21, #28, @jdeisenberg)
- (Breaking) Make splitWhen consistent with splitAt (removed option return type) (#25, @jdeisenberg)
- Add significant documentation (#16, @jdeisenberg)
Result:
- Fix pp() output for Error (#29, @jdeisenberg)
- Add significant documentation (#30, @jdeisenberg)
- Add functions for constructors: succeed, fail (#40, @bkase)
Option:
- Add significant documentation (#32, #41, @jdeisenberg)
- (Breaking) Remove foldrValues (#33, @jdeisenberg)
- Add function for constructor: some (#40, @bkase)
Char:
- Add module (#14, #17, @Dean177)
- Add significant documentation (#42, @jdeisenberg)
Int:
- Add significant documentation (#43, @jdeisenberg)
Tuple2:
- Add create, first, second, mapFirst, mapSecond, mapEach (#4, @Dean177)
- Add mapEach, mapAll, swap, toList (#6, @Dean177)
- Add curry, uncurry (#10, @Dean177)
- Add significant documentation (#44, @jdeisenberg)
Tuple3:
- Add module (#5, #6, #10, @Dean177)
String:
- Add reverse (#3, @Dean177)
Regex:
- Remove module (#1, #38, @bkase)
Fix types of elemIndex
Unify the module t
s with the native t
s uses to implement them.
Add a lot of new functions:
- Result.andThen
- List.elemIndex
- Option.toOption
- {StrStr,IntSet}.remove
- {StrStr,IntSet}.add
- {StrStr,IntSet}.set
- {StrStr,IntSet}.has
- {StrDict,IntDict}.merge
Add regex module to rescript. The contract will probably change in future versions because native regex uses an API that can't easily be made match.
Add pp functions for show derivers
Use individual mlis for each library - there are some minor differences we want to allow.
First release