Liking cljdoc? Tell your friends :D

uncomplicate.fluokitten.test

Macros that generate Midje tests for various laws that categorical concepts have to satisfy. You should use these tests to check if your implementations of clojure protocols are valid beyond what the compiler can assert.

Macros that generate Midje tests for various laws that
categorical concepts have to satisfy. You should use these tests
to check if your implementations of clojure protocols are valid
beyond what the compiler can assert.
raw docstring

applicative-law1cljmacro

(applicative-law1 f x & xs)

Generates a test that checks if the applicative functor x satisfies the first applicative law:

(fapply (pure x f) x) => (fmap f x)

Generates a test that checks if the applicative functor x
satisfies the first applicative law:

(fapply (pure x f) x) => (fmap f x)
sourceraw docstring

applicative-law2-identitycljmacro

(applicative-law2-identity x)

Generates a test that checks if the applicative functor x satisfies the second applicative law:

(fapply (pure x identity) x) => x

Generates a test that checks if the applicative functor x
satisfies the second applicative law:

(fapply (pure x identity) x) => x
sourceraw docstring

applicative-law3-compositioncljmacro

(applicative-law3-composition u v x & xs)

Generates a test that checks if the applicative functor x satisfies the third applicative law:

(<*> (pure x (curry comp)) u v x) => (fapply u (fapply v x))

Generates a test that checks if the applicative functor x
satisfies the third applicative law:

(<*> (pure x (curry comp)) u v x)
=> (fapply u (fapply v x))
sourceraw docstring

applicative-law4-homomorphismcljmacro

(applicative-law4-homomorphism ap f x & xs)

Generates a test that checks if the applicative functor x satisfies the fourth applicative law:

(fapply (pure a f) (pure a x)) => (f x)

Generates a test that checks if the applicative functor x
satisfies the fourth applicative law:

(fapply (pure a f) (pure a x)) => (f x)
sourceraw docstring

applicative-law5-interchangecljmacro

(applicative-law5-interchange ap f x & xs)

Generates a test that checks if the applicative functor x satisfies the fifth applicative law:

(fapply u (pure a y)) => (fapply (pure a fn(% y)) u)

Generates a test that checks if the applicative functor x
satisfies the fifth applicative law:

(fapply u (pure a y)) => (fapply (pure a fn(% y)) u)
sourceraw docstring

check-eqclj

(check-eq expected)
(check-eq expected actual)

Midje checker that check for the equality of contents in contexts such as references and reducibles.

Midje checker that check for the equality of contents in contexts such
as references and reducibles.
sourceraw docstring

data-structures-should-preserve-metadatacljmacro

(data-structures-should-preserve-metadata f1 f2 builder x y)

Generates the tests that check whether the implementations of functions defined in Fluokitten protocols that extend Clojure core data structures preserve metadata.

Generates the tests that check whether the implementations
of functions defined in Fluokitten protocols that extend
Clojure core data structures preserve metadata.
sourceraw docstring

extract-is-dual-of-purecljmacro

(extract-is-dual-of-pure m v)
source

fapply-keeps-typecljmacro

(fapply-keeps-type f x & xs)

Generates a test that checks if the applicative functor x's implementation of fapply keeps the type of x when the function inside f is applied to its content.

Generates a test that checks if the applicative functor x's
implementation of fapply keeps the type of x when the function
inside f is applied to its content.
sourceraw docstring

fmap-keeps-typecljmacro

(fmap-keeps-type f x & xs)

Generates a test that checks if the functor x's implementation of fmap keeps the type of x when f is applied to its content.

Generates a test that checks if the functor x's implementation of
fmap keeps the type of x when f is applied to its content.
sourceraw docstring

functor-law2cljmacro

(functor-law2 f x)
(functor-law2 f g x & xs)

Generates a test that checks if the functor x satisfies the Second Functor Law:

(fmap (comp f g)) => (fmap f (fmap g))

or, when applied to a concrete functor:

(fmap (comp f g) x) => (fmap f (fmap g x))

Generates a test that checks if the functor x satisfies
the Second Functor Law:

(fmap (comp f g)) => (fmap f (fmap g))

or, when applied to a concrete functor:

(fmap (comp f g) x) => (fmap f (fmap g x))
sourceraw docstring

magma-op-keeps-typecljmacro

(magma-op-keeps-type x y & ys)

Generates a test that checks if the operation op is closed on magma x.

Generates a test that checks if the operation op is closed on magma x.
sourceraw docstring

monad-law1-left-identitycljmacro

(monad-law1-left-identity m g x & xs)

Generates a test that checks if the monad x satisfies the first monad law:

(bind (pure m x) f) => (g x)

Generates a test that checks if the monad x
satisfies the first monad law:

(bind (pure m x) f) => (g x)
sourceraw docstring

monad-law2-right-identitycljmacro

(monad-law2-right-identity m)

Generates a test that checks if the monad x satisfies the secondmonad law:

(bind m (pure m)) => m

Generates a test that checks if the monad x
satisfies the secondmonad law:

(bind m (pure m)) => m
sourceraw docstring

monad-law3-associativitycljmacro

(monad-law3-associativity f g m & ms)

Generates a test that checks if the monad x satisfies the third monad law:

(bind m (fn [x] (bind (f x) g)

Generates a test that checks if the monad x
satisfies the third monad law:

(bind m (fn [x] (bind (f x) g)
sourceraw docstring

monoid-identity-lawcljmacro

(monoid-identity-law x & xs)

Generates a test that checks whether the Monoid implementation x satisfies the monoid identity law, i.e. if identity element for op exists: (op x (id x)) => x (op (id x) x) => x

Generates a test that checks whether the Monoid implementation x
satisfies the monoid identity law, i.e. if identity element for op
exists:
   (op x (id x)) => x
   (op (id x) x) => x
sourceraw docstring

semigroup-op-associativitycljmacro

(semigroup-op-associativity x y & ys)

Generates a test that checks if x and op form a semigroup, i.e whether op is associative:

(op (op a b)) => (op a (op b c))

Generates a test that checks if x and op form a semigroup,
i.e whether op is associative:

(op (op a b)) => (op a (op b c))
sourceraw docstring

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

× close