Skip to content

quasiquoting/pynchon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pynchon

Build Status Hex.pm Min Erlang version Documentation Eclipse Public License

A collection of arrow macros.

Ported from @rplevy's Clojure library, swiss-arrows. See its README for usage examples.

Muted post horn

"Muted post horn" image created by Zafiroblue05 and distributed under the CC BY-SA 3.0 license.

Installation

Add pynchon to your deps in your rebar.config:

{deps, [
  {pynchon, "0.5.0"}
]}.

Usage

To use the arrow macros, you can either include arrows.lfe:

(include-lib "pynchon/include/arrows.lfe")

(defun foo ()
  (-<>< (+ 1 2)
        (list <> 2 1)
        (list 5 <> 7)
        (list 9 4 <>)))

... or make fully-qualified calls to the exported macros:

(defun bar ()
  (pynchon:-<>< (+ 1 2)
                (list <> 2 1)
                (list 5 <> 7)
                (list 9 4 <>)))

Documentation

For (sparse) documentation, check out the Lodox-generated API docs.

Be sure to peruse the usage examples in the original swiss-arrows repo, too.
Although some Clojure idioms therein don't translate to LFE, the general ideas apply.

Credits

Copied from the swiss-arrows README.

Walter Tetzner, Stephen Compall, and I designed and implemented something similar to the "diamond wand" a couple of years ago.

Thanks to Alex Baranosky, Roman Perepelitsa, Paul Dorman, @rebcabin, and Stephen Compall for code contributions and conceptual contributions.

License

Copyright (C) 2012 Robert P. Levy

Copyright (C) 2015-2016 Eric Bailey

Distributed under the Eclipse Public License, the same as Clojure.