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.joinArray.cloneArray.lastArray.sortArray.countArray.includesArray.minimumArray.maximumArray.extentArray.filterMapArray.flattenArray.zipArray.partitionArray.splitAtArray.splitWhenArray.unzipArray.forEachWithIndexArray.valuesArray.chunksOfArray.groupByArray.equalArray.compare
Array.empty
Bool.fromIntBool.fromString( && )( || )Bool.xorBool.notBool.toStringBool.toIntBool.equalBool.compare
Char.equalChar.compare
The functions now use a new type Radians:
Float.fromPolarFloat.from_polarFloat.cosFloat.acosFloat.sinFloat.asinFloat.tanFloat.atanFloat.atan2
These functions now return Radians:
Float.degreesFloat.radiansFloat.turnsFloat.toPolarFloat.to_polar
- type
Radians Float.epsilonFloat.largestValueFloat.smallestValueFloat.maximumSafeIntegerFloat.minimumSafeIntegerFloat.fromStringFloat.isIntegerFloat.isSafeIntegerFloat.toStringFloat.equalFloat.compare
Fun.curry- renamed fromTuple2.curryFun.uncurry- renamed fromTuple2.uncurryFun.curry3- renamed fromTuple3.curryFun.uncurry3- renamed fromTuple3.uncurry
Fun.negateFun.foreverFun.times
( /. )- floating point division; renamed from( // )
modequalcompare
List.initial- renamed fromList.initList.sort- renamed fromList.sortWithList.includes- renamed fromList.memberList.fold- renamed fromList.foldLeftList.partition- renamed fromList.spanList.forEach- renamed fromList.iterList.join- renamed fromList.concatList.mapWithIndex- renamed fromList.indexedMap,List.mapiList.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.emptyList.singletonList.rangeList.updateAtList.countList.extentList.filterWithIndexList.flatMapList.flattenList.zipList.map3List.unzipList.forEachWithIndexList.chunksOfList.groupByList.toArrayList.equalList.compare
List.getBy- was the same asList.findList.elemIndex- useList.findIndexinstead
Option.unwrap- renamed fromOption.withDefaultOption.unwrapUnsafe- renamed fromOption.getExn
Option.and_Option.bothOption.flattenOption.map2Option.isNoneOption.tapOption.toArrayOption.equalOption.compare( |? )-Option.get( >>| )-Option.map( >>| )-Option.andThen
Result.ok- renamed fromResult.succeedResult.error- renamed fromResult.failResult.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.attemptResult.isOkResult.is_okResult.is_errorResult.and_Result.or_Result.orElseResult.bothResult.flattenResult.unwrapLazyResult.unwrapUnsafeResult.unwrap_unsafeResult.unwrapErrorResult.unwrap_errorResult.valuesResult.mapErrorResult.map_errorResult.tapResult.equalResult.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
Mapmodule, instead ofIntDictandStrDict. -
These functions now take a module parameter to pass the comparator. You can use the versions in the
Map.Poly,Map.IntorMap.Stringmodules which have an implicit comparator: -
Map.empty -
Map.singleton -
Map.fromArray -
Map.fromList
Map.add- renamed fromIntDict.insert,StrDict.insert
Map.Of()Map.emptyMap.singletonMap.fromArrayMap.fromList( .?{}<- )-Map.addMap.remove( .?{} )-Map.getMap.isEmptyMap.lengthMap.anyMap.allMap.findMap.includesMap.minimumMap.maximumMap.extentMap.mapWithIndexMap.filterMap.partitionMap.foldMap.forEachMap.forEachWithIndexMap.valuesMap.toArrayMap.Poly.emptyMap.Poly.singletonMap.Poly.fromArrayMap.Poly.fromListMap.Int.singletonMap.Int.fromArrayMap.String.singletonMap.String.fromArray
IntDict.toStringIntDict.ppStrDict.toStringStrDict.pp
Renamed from IntSet and StrSet.
- All functions are part of the
Setmodule, instead ofIntSetandStrSet. - These functions now take a module parameter to pass the comparator. You can use the
versions in the
Set.Poly,Set.IntorSet.Stringmodules which have an implicit comparator:
Set.add- renamed fromIntSet.set,StrSet.setSet.includes- renamed fromIntSet.member,StrSet.member,IntSet.has,StrSet.hasSet.difference- renamed fromIntSet.diff,StrSet.diffSet.fromList- renamed fromIntSet.ofList,StrSet.ofList
type (‘a, ‘id)type identitySet.emptySet.singletonSet.fromArraySet.lengthSet.findSet.anySet.allSet.intersectionSet.filterSet.partitionSet.foldSet.forEachSet.toArraySet.toListSet.Poly.emptySet.Poly.singletonSet.Poly.fromArraySet.Poly.fromListSet.Int.emptySet.Int.singletonSet.Int.fromArraySet.Int.fromListSet.String.emptySet.String.singletonSet.String.fromArraySet.String.fromList
IntSet.ppStrSet.pp
String.toLowercase- renamed fromString.toLowerString.toUppercase- renamed fromString.toUpper
String.fromArrayString.initializeString.getString.getAt( .?[] )-String.getAtString.isEmptyString.includesString.indexOfString.indexOfRightString.trimLeftString.trimRightString.padLeftString.padRightString.forEachString.foldString.toArrayString.toListString.equalString.compare
Tuple2.make- renamed fromTuple2.create
type ('a, 'b) t = 'a * 'bTuple2.fromArrayTuple2.fromListTuple2.equalTuple2.compare
Tuple3.make- renamed fromTuple3.createTuple3.initial- renamed fromTuple3.init
type ('a, 'b, 'c) t = 'a * 'b * 'cTuple3.fromArrayTuple3.fromListTuple3.toArrayTuple3.equalTuple3.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
Makefilewith common commands (#68, #69, @wpcarro) Makefileimprovements (#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,hypotenuseandinRangefunctions are introduced round,floor,ceilingandtruncatereturn afloatinstead of anintwithFloat.toIntserving as the only way to convert to an integer.roundhas 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.logBasebecomeslog ~base:min,max,mod,sqrtandabsget non-abbreviated namesremainderByandmodBydrop the 'By' and get a labelled argumentclampandinRangecan throw an exception if theupperargument is less than thelowerargument.
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
getandset(#74, @dmnd) - change
emptyto be a function (requirement in latest bs-platform) (#104 @Coobaha)
Option:
- add
getExn(#65, dmnd)
Result:
- add
fromOption(#66, wpcarro) - use
~finResult.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 ts with the native ts 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