Hacker News new | ask | show | jobs
by 77544cec 2350 days ago
For those that are interested, I gathered in a gist some functional combinators I have been writing over the years.

As a personal name convention, I use '|' (the piping character) as a suffix to name any function returning a function, which includes function combinators. Thus the naming of these functions becomes straighforward: 'every-pred' becomes 'and|' while 'some-fn' turns into 'or|'.

Example:

    (filter (and| pos? even?) nums)
    (filter (or|  neg? odd?)  nums)
More: https://gist.github.com/TristeFigure/acd689f3c57e840ebb9f8a6...
1 comments

Thank you for sharing this! Another useful library with "missing" functions is Medley[0] by James Reeves.

[0] https://github.com/weavejester/medley