Skip to content

Releases: reazen/relude

v0.30.0

22 Oct 04:11
Compare
Choose a tag to compare

✨ New

  • @RawToast - added semi/subflatMap for OptionT/ResultT/ReaderT
    • These functions are useful for performing a flatMap-like operation on either the "outer" or "inner" monad of these monad transformers.

v0.29.0

15 Oct 18:05
Compare
Choose a tag to compare

✨ New features

  • @johnhaley81 labeled arguments to add clarity to ORD-related comparison functions

v0.28.2

15 Oct 17:43
Compare
Choose a tag to compare

🐛 Bug fixes

v0.28.1

26 Sep 16:37
Compare
Choose a tag to compare

✔️ Code quality

  • Contribution from @bobzhang to change uses of bs.raw to just raw

v0.28.0

17 Sep 05:04
Compare
Choose a tag to compare

✨ New

  • Closed #151 - added a bunch of Int and Float math helper functions and typeclasses instances
    • Int: zero, one, add, subtract, multiply, divide, modulo, divideWithModulo, divideAsFloat, top, bottom, degree, Bounded instance, EuclideanRing instance
    • Float: mostly the same as Int
  • Closed #164 - added various tap functions for performing side effects for some of the modules that operate on variant types
    • Option - tap, tapSome (alias for tap), tapNone, bitap
    • AsyncData - tap functions for various combinations of values
    • AsyncResult - tap functions for various combinations of values
    • Ior - tap functions for various combinations of values

🐛 Bug fixes

  • Closed #101 - Unhandled promise rejection warnings - @mlms13 found the fix for the unhandled rejection warnings - the problem was that we were returning the failed promise value from the catch. Instead, we now return a Js.Promise.resolved unit value in the success and failure handlers, after calling the onDone callback for the IO.
  • @esbullington - fixed a typo with AsyncResult.toIdle pointing at AsyncData.toBusy rather than AsyncData.toIdle

v0.27.0

31 Aug 04:24
Compare
Choose a tag to compare

✨ New

Added some boolean algebra-related functions and other utilities to Relude.Bool. We had modules for things like Eq, Ord, and Show, but the top-level functions weren't exposed, so I added them for convenience.

  • not_ (alias for inverse, just to help people trying to use autocomplete)
  • and_
  • or_
  • nand
  • nor
  • xor
  • xnor
  • implies
  • eq
  • compare
  • show

v0.26.0

23 Aug 21:56
Compare
Choose a tag to compare

✨ New

Added a few low-level helper functions to the Relude.Js.Json module:

  • fromOption - helper for encoding an option('a) value to JSON (falling back to null)
  • validateOptional - helper for decoding a value that might be null
  • validateOptionalAtIndex - helper for decoding a value in an array, where you might have a bad index, the value might be null, or the validation might fail
  • validateOptionalForKey - helper for decoding a value in an object, where you might have a missing key, the value might be null, or the validation might fail

These are also exposed in abbreviated form in the Relude.Js.Json.DSL:

  • JE.opt - same as fromOption
  • JD.opt - same as validateOptional
  • JD.optAt - same as validateOptionalAtIndex
  • JD.optFor - same as validateOptionalForKey

Also filled in some missing documentation for Relude.Js.Json module.

v0.25.1

20 Aug 22:27
Compare
Choose a tag to compare

✨ New stuff

v0.25.0

20 Aug 20:15
Compare
Choose a tag to compare

✨ New stuff

  • @johnhaley81 - Added groupListBy and groupArrayBy functions to Relude.Map for grouping arrays/lists into maps by converting each list/array item into a Comparable key value.

v0.24.0

16 Aug 03:01
Compare
Choose a tag to compare

✨ New stuff

List and Array Zippers

A list/array zipper is a sequential data structure that tracks a single selected or focused item, and the sequence of items immediately to the left and right of the focused item. The list-based implementation allows efficient navigation to and modification of the focused item, and the items immediately to the left or right of the focus. A zipper is useful to doing contextual navigation and updates of sequential data, tracking a single selected item from a list of items, etc. A zipper gives you the ability to "look around" at nearby items when focused on some single item.

The following presentation gives a great overview of zippers, and some of theory behind them: http://data.tmorris.net/talks/zippers/0a1062fd0526d7ac1f41ade1e4db1465d311b4fd/zippers.pdf

This implementation was inspired by several existing implementations by mostly the Queensland Functional Programming Lab (qfpl)'s implementation here: https://github.com/qfpl/list-zipper

  • Added SequenceZipper - a module functor that can be used to create a zipper using any data type that has a SEQUENCE implementation (i.e. List or Array).
  • Added ListZipper a concrete zipper implementation backed by a list
  • Added ArrayZipper a concrete zipper module backed by an array

See the code for an overview of the functions available.

The ListZipper is the preferred implementation because of it's ideal semantics with moving the focus left and right in O(1) time. An ArrayZipper is also provided, but the performance characteristics are likely worse than the ListZipper.