All Versions
4
Latest Version
Avg Release Cycle
181 days
Latest Release
1393 days ago

Changelog History

  • v2.3.0 Changes

    June 27, 2017

    Compose functions, from the head of the list of functions. The is the reverse
    order versus what one would normally expect (left-to-right rather than
    right-to-left).

    Examples

     iex\> sum\_plus\_one = compose\_list([&(&1 + 1), &Enum.sum/1]) ...\> sum\_plus\_one.([1, 2, 3]) 7
    
  • v2.2.0 Changes

    September 12, 2016

    Pointfree unary functions!

    ๐Ÿ‘ Allows defining functions as straight function composition (ie: no need to state the argument). Provides a clean, composable named functions. Also doubles as an aliasing device.

    defmodule Foo douse Quark defx foo, do: Enum.sum |\> succ defx bar, do: ((&Enum.sum/1) \<~\> succ).()end[1,2,3] |\> Foo.foo#=\> 7[1,2,3] |\> Foo.bar#=\> 7
    

    ๐Ÿฑ Pointfree n-ary functions (based on the first function in the body) is still coming ๐Ÿ˜„

  • v2.0.0 Changes

    August 29, 2016

    ๐Ÿšš Nothing terribly major. The breaking change is that a number of top-level functions have moved into submodules, and there's now a handy top-level use macro.

    โšก๏ธ Also modernized the deps, updated the docs, and altered the layout of the doctests for readability.

  • v1.0.0 Changes

    January 02, 2016

    ๐Ÿš€ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ Happy New Year and a happy first Quark release! ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰

    Quark 1.0.0 has arrived! Having recently undergone mitosis from Witchcraft, we've fleshed out quite a few functional programming basics that we felt would be useful in Elixir.

    Functional Overview

    SKI combinators

    Yes, now you too can define all of your algorithms in incomprehensible strings of s and k! Get your s k (k k) on! But seriously, a lot of this stuff is pretty useful. We've provided friendlier names at the top-level Quark module, so that you can write const, rather than having remember what k does.

    BCKW combinators

    The classic b, c, k, and w combinators of lore. Pretty much the same idea as with SKI, but some different functionality. And as usual, we've aliased the names at the top-level.

    ๐Ÿ›  Fixed Point

    ๐Ÿ›  Fixed point combinators, for helping with recursion. Several formulations are provided, but stick to fix (should be the most efficient at any given time, and thus somewhat more future-proof).

    Compose

    Compose functions to do convenient partial applications. Versions for composing left-to-right and right-to-left are provided, but the operator <|> is done "the math way" (right-to-left). Versions on lists also available.

    Sequence

    Really here for pred and succ on integers, by why stop there? This works with any ordered collection.

    Curry

    Functions

    curry creates a 0-arity function that curries an existing function. uncurry applies arguments to curried functions, or if passed a function creates a function on pairs.

    Macros

    Why define the function before currying it? defcurry and defcurryp return fully-curried 0-arity functions.

    Partial

    ๐Ÿฑ ๐Ÿ‘‘ We think that this is really the crowning jewel of Quark. defpartial and defpartialp create all arities possible for the defined function, bare, partially applied, and fully curried. This does use up all the full arity-space for that function name, however.

    Closing Remarks

    We hope that you enjoy Quark! Please let us know if you have new feature requests.

    With humanity,

    ~ Robot Overlord Inc.