Liking cljdoc? Tell your friends :D

sicmutils.structure


compatible-shapeclj/s

(compatible-shape s)

Return an object compatible for multiplication with the given one, with the slots filled with gensyms.

Return an object compatible for multiplication with the given one, with
the slots filled with gensyms.
sourceraw docstring

componentclj/s

(component & indices)

Given an access chain (a sequence of indices), return a function of structures that will retrieve that corresponding element.

Given an access chain (a sequence of indices), return a function of
structures that will retrieve that corresponding element.
sourceraw docstring

dimensionclj/s

(dimension s)
source

downclj/s

(down & xs)

Construct a down (covariant) tuple from the arguments.

Construct a down (covariant) tuple from the arguments.
sourceraw docstring

flip-indicesclj/s

(flip-indices s)

Make a tuple with the same shape as s but all orientations inverted.

Make a tuple with the same shape as s but all orientations inverted.
sourceraw docstring

generateclj/s

(generate dimension orientation f)

Generate a structure with the given orientation whose elements are (f i) where i ranges from [0..dimension)

Generate a structure with the given orientation whose elements are (f i)
where i ranges from [0..dimension)
sourceraw docstring

maprclj/s

(mapr f & structures)

Return a structure with the same shape as s but with f applied to each primitive (that is, not structural) component.

Return a structure with the same shape as s but with f applied to
each primitive (that is, not structural) component.
sourceraw docstring

oppositeclj/s

(opposite s xs)

Make a tuple containing xs with the orientation opposite to s.

Make a tuple containing xs with the orientation opposite to s.
sourceraw docstring

orientationclj/s

(orientation s)

Return the orientation of s, either ::up or ::down.

Return the orientation of s, either ::up or ::down.
sourceraw docstring

sameclj/s

(same s xs)

Make a tuple containing xs with the same orientation as s.

Make a tuple containing xs with the same orientation as s.
sourceraw docstring

Structurecljs

source

structure->access-chainsclj/s

(structure->access-chains s)

Return a structure of the same shape as s whose elements are access chains corresponding to position of each element (i.e., the sequence of indices needed to address that element).

Return a structure of the same shape as s whose elements are access
chains corresponding to position of each element (i.e., the sequence
of indices needed to address that element).
sourceraw docstring

structure->vectorclj/s

(structure->vector s)

Return the structure in unoriented vector form.

Return the structure in unoriented vector form.
sourceraw docstring

structure-assoc-inclj/s

(structure-assoc-in s [k & ks] value)

Like assoc-in, but works for structures. At this writing we're not sure if we want to overwrite the stock definition of assoc-in to something that would fall through for standard clojure data types

Like assoc-in, but works for structures. At this writing we're not
sure if we want to overwrite the stock definition of assoc-in to
something that would fall through for standard clojure data types
sourceraw docstring

structure?clj/s

(structure? s)

True if s is a structure.

True if s is a structure.
sourceraw docstring

unflattenclj/s

(unflatten values struct)
(unflatten constructor values struct)

Given a sequence of values and a model structure, unpack the values into a structure with the same shape as the model.

Given a sequence of values and a model structure, unpack the values into
a structure with the same shape as the model.
sourceraw docstring

upclj/s

(up & xs)

Construct an up (contravariant) tuple from the arguments.

Construct an up (contravariant) tuple from the arguments.
sourceraw docstring

up?clj/s

(up? s)

True if s in an up structure.

True if s in an up structure.
sourceraw docstring

vector->downclj/s

(vector->down v)

Form a down-tuple from a vector.

Form a down-tuple from a vector.
sourceraw docstring

vector->upclj/s

(vector->up v)

Form an up-tuple from a vector.

Form an up-tuple from a vector.
sourceraw docstring

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

× close