Skip to content

0.4.0

Compare
Choose a tag to compare
@zth zth released this 07 Jul 11:07
· 105 commits to main since this release

API changes

  • Map, Set, WeakMap, WeakSet: use the types defined in the Js namespace. #143
  • Symbol: use the types defined in the Js namespace. #145
  • The types RescriptCore.Type.function and RescriptCore.Type.object use the types defined in the Js namespace. #146
  • The type RescriptCore.Type.symbol removed in favor of RescriptCore.Symbol.t. #146
  • Added BigInt support for RescriptCore.Classify.t. #146
  • Array mutable & immutable helper name changed to conform to JS' upcoming APIs such as toSorted
    • sort -> toSorted, sortInPlace -> sort
    • reverse -> toReversed, reverseInPlace -> reverse
    • splice -> toSpliced, spliceInPlace -> splice
    • shuffle -> toShuffled, shuffleInPlace -> shuffle
    • fillAllInPlace -> fillAll, fillInPlaceToEnd -> fillToEnd, fillInPlace -> fill
    • added with
  • Same for TypedArray:
    • sort -> toSorted, sortInPlace -> sort
    • reverse -> toReversed, reverseInPlace -> reverse
    • fillAllInPlace -> fillAll, fillInPlaceToEnd -> fillToEnd, fillInPlace -> fill
  • And List:
    • shuffle -> toShuffled
  • Use float instead of int for ordering to avoid premature overflow. #149
  • Add Ordering module. #149

Note 1: These changes should all produce the correct type errors. Though TypedArray's reverse and sort previously mutated and returned the mutated array itself, whereas now they'd be copies. Please be careful refactoring these 2.

Note 2: the newly added helpers, Array.toSorted, Array.toSpliced, Array.toReversed, Array.with, TypedArray.toSorted and TypedArray.toReversed require their respective polyfill, as they're not currently supported by Firefox.