Releases: reazen/relude
v0.23.0
Documentation release
✨ New stuff
Added documentation to the majority of the functions in the library. Our current stance is to not use the .rei interfaces because of the pain it creates with our include
magic, so I went ahead and put in docs in the .re files. I'll remove the Array and List.rei files in another release.
🚨 Breaking changes
Several modules/module functors were renamed for the sake of consistency across the library. These naming conventions don't need to be set in stone this way, but I at least wanted things to be consistent across our modules. I know the Make
convention is common in ocaml module functors, but we don't have a convention for using that in relude at the moment. We can move in that direction, but we need to consider how to name the extension module functions, specifically the nested ones like Foldable
to avoid conflicts with names like Make
.
HMap.Make
->HMap.WithKeyMeta
(for consistency with things likeResult.WithError
,IO.WithError
HMap.WithUnitKeyMeta
->HMap.WithKeyMetaUnit
- named to sound more like how its constructed with the module functorHMap.WithKeyMeta(Unit.Type)
ContT.WithEnv
->ContT.WithResult
- fixes an incorrect name for the result type moduleContT.WithMonadAndEnv
->ContT.WithMonadAndResult
- fixes incorrect nameMap.Map
->Map.MAP
- we followed the convention of bs-abstract naming module types in all capsMap.MakeWithOrderable
->Map.WithOrd
- consistency withResult.WithError
, etc.Set.Set
->Set.SET
- module types in all caps, like bs-abstractRelude_Extensions_Ord.Make
->Relude_Extensions_Ord.OrdExtensions
- consistency with other extensions that have the{Module}Extensions
and{Module}Infix
module functorsRelude_Extensions_Ord.MakeWithRing
-> moved insideRelude_Extensions_Ord.OrdExtensions.OrdRingExtensions
- for consistency with the nestedFoldable
extensionsRelude_Extensions_Ring.Make
->Relude_Extensions_Ring.RingExtensions
- for consistency with other extensions named like{Module}Extensions
and{Module}Infix
v0.22.0
✨ New stuff
- Add
Nea
,Nel
,NonEmptyArray
, andNonEmptyList
toRelude.Globals
v0.21.0
✨ New stuff
Relude.HList
- an initial heterogeneouslist
type - a list that can store values of different types, in a type-safe way- TODO: ways to
fold
/map
/etc. with polymorphic functions?
- TODO: ways to
Relude.HMap
- an initial heterogeneousmap
type - a map that can store values of different types, in a type-safe way
🚨 Breaking changes
Relude.String
function minor refactor- Many of the
Relude.String
functions accept multiple ambiguousstring
arguments - this release has changed several of these methods to use named args for the non-primarystring
arguments. - Affected functions:
endsWith
startsWith
contains
indexOf
lastIndexOf
splitList
splitArray
replaceFirst
replaceEach
replaceRegex
removeFirst
removeEach
- The refactor should be straightforward to fix. The argument order has not changed, but the non-last string arguments now have labels. Add argument names like
~search
,~replaceWith
,~delimiter
etc.
- Many of the
v0.20.0
This release focuses on improving int and float helpers. Additionally, a few modules and functions have been added to Globals
, plus the usual bugfixes and consistency updates.
🚨 Breaking changes
- Remove
State
,Reader
, andWriter
fromRelude.Globals
, due to the possibility of collision. They can still be accessed viaRelude.Globals.StateT.State
etc
✨ New stuff
String
andInt
joinFloat
in bringing alongOrd
extras (e.g.min
,gte
, etc)- Add
clamp
andbetween
toOrd
(along with all modules that implementOrd
) - Make
float
andint
members ofSemiring
andRing
- Add
abs
andsignum
to all modules that implement bothOrd
andRing
open Relude.Globals
now bringsBool
,inverse
,Void
, andabsurd
into scopeArray
includesmapOption
andcatOption
, which work similarly to theirList
counterparts- add
Int.toFloat
,Int.fromFloat
,Float.toInt
, andFloat.fromInt
- add several rounding/precision functions to
Float
, includingfloor
,ceil
, andround
, plus versions of each that convert the result to anint
🐛 Bug fixes
- Fix typo in
String.isNonWhitespace
name (technically this is a breaking change...)
✔️ Code quality
- Test coverage improved, particularly for
String
v0.19.0
✨ New
- Changed
Result
andIO
catchError
function to allow changing the inner'e
error type. This should not break existing usages of the previously more restrictive version.
v0.18.0
✨ New stuff
- Added
replaceAt
forList
andArray
- replaces an item in theList
/Array
at the given index
v0.17.0
✨ New stuff
- Added
uncons
toNonEmpty.List
andNonEmpty.Array
to extract the contained values as a tuple of head and tail.
NonEmpty.List.uncons(NonEmpty.List.make(1, [2, 3])) // (1, [2, 3])
v0.16.0
✨ New Stuff
Relude.Tuple.apply2
-apply5
- allows you to apply a normal curried function to a tuple of arguments
(1, 2, 3) |> Relude.Tuple.apply3((a, b, c) => a + b + c) // 6
Relude.Function.curry2
-curry5
- allows you to convert a function that accepts a tuple of arguments to a normal curried function
See tests for examples
Relude.Function.uncurry2
-uncurry5
- allows you to convert a normal curried function into a function that accepts a tuple of arguments
See tests for examples
Relude.Extensions.ApplyExtensions.mapTuple2
-mapTuple5
- adds extension functions to all instances ofApply
which allow you to take a tuple of wrapped arguments and apply a pure function to them to produce a wrapped result. Similar tomap2
-map5
, but accepts a tuple of arguments rather than normal curried arguments. Any module that includesApplyExtensions
will now havemapTuple2-5
(Some(1), Some(2), Some(3)) |> Relude.Option.mapTuple3((a, b, c) => a + b + c) // Some(6)
Compared to similar map3:
Relude.Option.map3((a, b, c) => a + b + c, Some(1), Some(2), Some(3)) // Some(6)
v0.15.0
✨ New Stuff
Relude.Tuple
includes helpers for constructing tuples (from functions of a certain arity or from lists/arrays of a certain size)Relude.Extensions.Ord
includes a bunch of functions that come for free if your type can be ordered (e.g.min
,max
,lessThan
,lessThanOrEq
, etc). So far onlyRelude.Float
benefits from these new functions, but that will expand to other types in the near future.
🐛 Bug Fixes
List.Option.traverse
now correctly allows you to map from'a
to some other non-'a
type- The compiler was assuming
==
to be the polymorphic runtime equality function a few places where safe equality could be used instead (e.g. when comparing values known to befloat
s). This has been fixed, and the appropriate compiler warning is now enabled.