Liking cljdoc? Tell your friends :D

Notation

compose includes the namespace io.simplect.compose.notation providing a single Greek letter as an abbreviation.

The table below provides an overview of each abbreviated form (core refers to clojure.core, compose to io.simplect.compose):

NotationAbbreviatesIntended mnemonic
γcore/comp'c' (gamma) for compose
Γcompose/rcomp'C' (Gamma) for compose
πcore/partial'p' (pi) for partial
Πcompose/raptial'P' (Pi) for partial
χcompose/curry'k' (chi) for kurry
λcore/fn'lambda' for lambda
μcore/map'm' (mu) for map
ρcore/reduce'r' (rho) for reduce

Some people may prefer to not use these abbreviated forms, which require you (1) to remember the meaning of each and (2) may not be straightforward to enter on most keyboards.

Different computing environments offer different solutions to the character entry issue, below is a sketch of how to use Abbrevs in Emacs.

The author has rebound his keyboard to easily enter any Greek character, Emacs e.g. allows M-x set-input-method RET TeX enabling you to type \beta to get β, or allows you to define Abbrevs substituting input as you type it.

Since io.simplect.compose.notation is merely notation, you can opt to not use it without losing any of the functionality of compose.

Using the notation

The notation characters work best if they can be used without a namespace qualifier, either by simply requiring all of them

(ns myns
  (:require [io.simplect.compose.notation	:refer :all]))

or importing them individually as needed

(ns myns
  (:require [io.simplect.compose.notation	:refer [π Π γ Γ]]))

Defining Abbrevs in Emacs

If you use Emacs one way to enter the Greek characters is use Emacs' Abbrevs. Here's a brief introduction to defining abbreviations for the notation characters:

  1. Go to buffer in clojure-mode byffer (since we'll be defining mode-specific abbreviations)
  2. Do M-x set-input-method RET TeX RET to enable you to use TeX syntax for entering the characters
  3. Do M-x abbrev-mode to activate replacement of abbreviations
  4. Type \Gamma (immediately replaced by Γ)
  5. M-x add-mode-abbrev RET Gamma RET

Repeat for last two steps for remaining notation characters.

If you want use Abbrevs to enter the notation characters you'll need to activate it by adding it to the mode-hook for clojure-mode:

(add-hook clojure-mode-hook #'abbrev-mode)

Can you improve this documentation? These fine people already did:
Klaus Harbo & simplect-io
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close