Skip to content
master
Go to file
Code
This branch is 47 commits ahead, 1 commit behind yurrriq:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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.

You can’t perform that action at this time.