Releases: reazen/relude
v0.30.0
v0.29.0
✨ New features
- @johnhaley81 labeled arguments to add clarity to ORD-related comparison functions
v0.28.2
🐛 Bug fixes
- @johnhaley81 bug fix for
IO.summonError
never resolving #173
v0.28.1
v0.28.0
✨ New
- Closed #151 - added a bunch of
Int
andFloat
math helper functions and typeclasses instancesInt
:zero
,one
,add
,subtract
,multiply
,divide
,modulo
,divideWithModulo
,divideAsFloat
,top
,bottom
,degree
,Bounded
instance,EuclideanRing
instanceFloat
: mostly the same asInt
- Closed #164 - added various
tap
functions for performing side effects for some of the modules that operate on variant typesOption
-tap
,tapSome
(alias fortap
),tapNone
,bitap
AsyncData
- tap functions for various combinations of valuesAsyncResult
- tap functions for various combinations of valuesIor
- 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 aJs.Promise.resolved
unit
value in the success and failure handlers, after calling theonDone
callback for theIO
. - @esbullington - fixed a typo with
AsyncResult.toIdle
pointing atAsyncData.toBusy
rather thanAsyncData.toIdle
v0.27.0
✨ 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 forinverse
, just to help people trying to use autocomplete)and_
or_
nand
nor
xor
xnor
implies
eq
compare
show
v0.26.0
✨ New
Added a few low-level helper functions to the Relude.Js.Json
module:
fromOption
- helper for encoding anoption('a)
value to JSON (falling back tonull
)validateOptional
- helper for decoding a value that might be nullvalidateOptionalAtIndex
- helper for decoding a value in an array, where you might have a bad index, the value might be null, or the validation might failvalidateOptionalForKey
- 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 asfromOption
JD.opt
- same asvalidateOptional
JD.optAt
- same asvalidateOptionalAtIndex
JD.optFor
- same asvalidateOptionalForKey
Also filled in some missing documentation for Relude.Js.Json
module.
v0.25.1
✨ New stuff
- @johnhaley81 - #158 - Fix for signatures of
Map
groupBy
functions
v0.25.0
✨ New stuff
- @johnhaley81 - Added
groupListBy
andgroupArrayBy
functions toRelude.Map
for grouping arrays/lists into maps by converting eachlist
/array
item into aComparable
key value.
v0.24.0
✨ 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 aSEQUENCE
implementation (i.e.List
orArray
). - Added
ListZipper
a concrete zipper implementation backed by alist
- Added
ArrayZipper
a concrete zipper module backed by anarray
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
.