Skip to content

v0.16.0

Compare
Choose a tag to compare
@andywhite37 andywhite37 released this 03 Jul 01:22

✨ 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 of Apply which allow you to take a tuple of wrapped arguments and apply a pure function to them to produce a wrapped result. Similar to map2-map5, but accepts a tuple of arguments rather than normal curried arguments. Any module that includes ApplyExtensions will now have mapTuple2-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)