Take program design oddities in stride with Clojure/ClojureScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src/promenade
test-doo/promenade
test/promenade
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
project.clj

README.md

promenade

Build Status

Take program design oddities in stride with Clojure/ClojureScript.

Rationale

Non-trivial Clojure applications often need to deal with deeply nested conditions, complex error handling and potentially missing data. Naively applying Clojure's facilities to such problems may lead to brittle code that is hard to reason about. This library provides few basic mechanisms to decouple the tangled concerns.

Goals

  • Provide facilities to take apart code units and put back together in a cleaner way
  • Provide simple & effective API without the awkwardness of using monads in Clojure
  • Keep the surface area of this library's API small, fun and easy to work with

Non goals

  • Be faithful implementation of monads
  • Adapt all known monads (completeness)
  • Be limited to monadic ideas

Implemented features

  • Decouple condition checks from conditional action by representing success and failure (called Either)
  • Represent and deal with available and missing values (called Maybe)
  • Avoid imperativeness and coupling of throwing and catching of exceptions (called Trial)

Other work

You may find similarities to this library in the following work:

External references

Usage

Clojars Project

See Documentation

Discuss

Slack channel: #promenade (you need an invitation from http://clojurians.net/ to join the Clojurian Slack team)

Development

Running tests:

$ lein do clean, test       # run tests in lowest supported Clojure version
$ lein do clean, clj-test   # run tests in all supported versions of Clojure
$ lein do clean, cljs-test  # run tests in ClojureScript using NodeJS

License

Copyright © 2017-2018 Shantanu Kumar (kumar.shantanu@gmail.com, shantanu.kumar@concur.com)

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.