The core Morph library.
The core Morph library.
(<$ value functor)
Maps a functor to the same value.
Maps a functor to the same value.
(<*> af f & more)
Applies the receiver to the rest of the arguments. Unlike (app), this function takes a variable number of arguments.
Applies the receiver to the rest of the arguments. Unlike (app), this function takes a variable number of arguments.
(<< p q)
(<< p q & more)
Performs two or more actions; keeps the result of the first.
Performs two or more actions; keeps the result of the first.
(>> m k)
(>> m k & more)
Performs two or more actions; ignores the result of the first.
Performs two or more actions; ignores the result of the first.
The identity value for the All monoid.
The identity value for the All monoid.
The identity value for the Any monoid.
The identity value for the Any monoid.
A functor with application, providing operations to embed pure expressions and sequence computations to combine their results.
A functor with application, providing operations to embed pure expressions and sequence computations to combine their results.
(app this x)
Applies the first functor on its argument, which is either a single value of a collection.
Applies the first functor on its argument, which is either a single value of a collection.
(curry f)
(curry f n)
Returns a curried version of a function. Variadic functions must supplied the number of arguments.
Returns a curried version of a function. Variadic functions must supplied the number of arguments.
(defcurry fname & [f1 & fs :as all])
Defines a curried function that may be called as a partial or total function using the regular function-call notation. Partial applications yield functions that work the same way. When all arguments have been given it evaluates the body and returns its value. Takes an optional docstring, as defn.
Defines a curried function that may be called as a partial or total function using the regular function-call notation. Partial applications yield functions that work the same way. When all arguments have been given it evaluates the body and returns its value. Takes an optional docstring, as defn.
(flip f)
Returns a version of f with its first two arguments reversed.
Returns a version of f with its first two arguments reversed.
(fmap function functor)
A version of (fun) where the functor is last.
A version of (fun) where the functor is last.
(fst p)
Accessor for the first element of a pair.
Accessor for the first element of a pair.
The Functor protocol is used for types that can be mapped over. Instances of Functor should satisfy the following laws:
fmap id == id fmap (f . g) == fmap f . fmap g
The Functor protocol is used for types that can be mapped over. Instances of Functor should satisfy the following laws: fmap id == id fmap (f . g) == fmap f . fmap g
(fun this f)
Applies a function to a functor's data, producing a new functor.
Applies a function to a functor's data, producing a new functor.
(liftm f m)
Lifts a one-arg function to work with monads.
Lifts a one-arg function to work with monads.
(liftm2 f m1 m2)
Lifts a two-arg function to work with monads.
Lifts a two-arg function to work with monads.
(liftm3 f m1 m2 m3)
Lifts a three-arg function to work with monads.
Lifts a three-arg function to work with monads.
(liftm4 f m1 m2 m3 m4)
Lifts a four-arg function to work with monads.
Lifts a four-arg function to work with monads.
(mapm f coll)
Maps a one-arg monad constructor over a collection of values. Then it executes the actions in a sequence with (seqm).
Maps a one-arg monad constructor over a collection of values. Then it executes the actions in a sequence with (seqm).
(mcf args & body)
Makes a curried function off the arglist and body.
Makes a curried function off the arglist and body.
(mconcat coll)
Reduces the collection of monoids using their defined mappend for accumulation and mempty as initial value.
Reduces the collection of monoids using their defined mappend for accumulation and mempty as initial value.
(monad [& bindings] & body)
Monadic binding that expands into nested >>= forms and a function body.
The pattern:
(>>= p1 (fn [v1] (>>= p2 (fn [v2] ... (return (f v1 v2 ...))))))
can be more conveniently be written as:
(monad [v1 p1 v2 p2 ...] (return (f v1 v2 ...)))
Monadic binding that expands into nested >>= forms and a function body. The pattern: (>>= p1 (fn [v1] (>>= p2 (fn [v2] ... (return (f v1 v2 ...)))))) can be more conveniently be written as: (monad [v1 p1 v2 p2 ...] (return (f v1 v2 ...)))
A monadic type supports the chaining of sequential actions.
A monadic type supports the chaining of sequential actions.
(>>= m k)
Performs computation m and applies k to the result. Function k must return a monadic type.
Performs computation m and applies k to the result. Function k must return a monadic type.
(return this x)
Creates a monadic value of type this with value x. The receiver object is not used except for dispatching the right constructor.
Creates a monadic value of type this with value x. The receiver object is not used except for dispatching the right constructor.
Monads that support choice and failure; should satisfy:
mzero >>= f = mzero v >> mzero = mzero
Monads that support choice and failure; should satisfy: mzero >>= f = mzero v >> mzero = mzero
(mplus this m)
An associative operation with identity value mzero.
An associative operation with identity value mzero.
(mzero this)
Creates an identity value of type this with value x. The receiver is used to dispatch the right constructor.
Creates an identity value of type this with value x. The receiver is used to dispatch the right constructor.
Monoids have an associative binary operator with an identity value.
Monoids have an associative binary operator with an identity value.
(mappend this x)
Applies the operator defined by the instance on this and x.
Applies the operator defined by the instance on this and x.
(mempty this)
Returns the identity value of the receiver. Though this is actually a constructor, implementing this function makes it possible to write generic functions over monoids.
Returns the identity value of the receiver. Though this is actually a constructor, implementing this function makes it possible to write generic functions over monoids.
The identity value for the Product monoid.
The identity value for the Product monoid.
(seqm coll)
Executes actions in sequence; collects the results in a vector. The result is a new monad with the vector as its value. The collection argument must not be empty.
Executes actions in sequence; collects the results in a vector. The result is a new monad with the vector as its value. The collection argument must not be empty.
(seqm_ ms)
Executes actions in sequence, ignoring the results. The result is a new monad with an empty vector as its value.
Executes actions in sequence, ignoring the results. The result is a new monad with an empty vector as its value.
(snd p)
Accessor for the second element of a pair.
Accessor for the second element of a pair.
The identity value for the Sum monoid.
The identity value for the Sum monoid.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close