Skip to content

Releases: RougeWare/Swift-Function-Tools

1.2 - `constant`, another `echo`, and `!`

21 Jun 21:19
a854f4e
Compare
Choose a tag to compare

This release brings three new function generators:

  • echo(_:) - A new echo function which creates and returns a function which only ever returns the value you gave the echo function
  • constant(_:) - Two functions which always return the same value: one just like the above echo function (purely alias for clarity), and one which creates a non-transformer which ignores its input always returns the same value
  • ! - Creates a function which simply inverts the output of the function after the exclamation point

See the Readme for examples!


Patch Changes

  • 1.2.4
    • #13: Made the curry function public
  • 1.2.3
    • Added a dynamic library product whose name is a valid bundle identifier
    • Deprecated previous dynamic library product because its name caused problems when submitting to the App Store
  • 1.2.2
    • Added alternative dynamic library product
  • 1.2.1
    • Added dual licenses

1.1.0 - Added `echo` functions

20 May 15:56
b813c5f
Compare
Choose a tag to compare

Like it says on the tin, these just echo what they're given.

The first version simply returns the value it's given. This is useful for reusing the input of higher-order functions:

let withoutNils = arrayOfOptionals.compactMap(echo)

The second version is useful for flattening collections of generators:

let values = generators.map(echo)

1.0.0 - MVP

17 Apr 03:31
9750466
Compare
Choose a tag to compare

Just a few things that I've written and re-written over and over again over several projects, just to make functions a little nicer 🙂