Liking cljdoc? Tell your friends :D

grimoire.things

This namespace implements a "thing" structure, approximating a URI, for uniquely naming and referencing entities in a Grimoire documentation store.

Thing ::= Sum[Group, Artifact, Version, Platform, Namespace, Def, Note, Example]; Group ::= Record[ Name: String]; Artifact ::= Record[Parent: Group, Name: String]; Version ::= Record[Parent: Artifact, Name: String]; Platform ::= Record[Parent: Version, Name: String]; Namespace ::= Record[Parent: Platform, Name: String]; Def ::= Record[Parent: Namespace, Name: String];

Note ::= Record[Parent: Thing, Handle: String]; Example ::= Record[Parent: Thing, Handle: String];

This namespace implements a "thing" structure, approximating a URI, for
uniquely naming and referencing entities in a Grimoire documentation
store.

Thing     ::= Sum[Group, Artifact, Version, Platform,
                  Namespace, Def, Note, Example];
Group     ::= Record[                   Name: String];
Artifact  ::= Record[Parent: Group,     Name: String];
Version   ::= Record[Parent: Artifact,  Name: String];
Platform  ::= Record[Parent: Version,   Name: String];
Namespace ::= Record[Parent: Platform,  Name: String];
Def       ::= Record[Parent: Namespace, Name: String];

Note      ::= Record[Parent: Thing,     Handle: String];
Example   ::= Record[Parent: Thing,     Handle: String];
raw docstring

->artifactclj

(->artifact parent name)

Generated constructor for the artifact type.

Generated constructor for the artifact type.
raw docstring

->defclj

(->def parent name)

Generated constructor for the def type.

Generated constructor for the def type.
raw docstring

->exampleclj

(->example parent name handle)

Generated constructor for the example type.

Generated constructor for the example type.
raw docstring

->groupclj

(->group name)

Generated constructor for the group type.

Generated constructor for the group type.
raw docstring

->namespaceclj

(->namespace parent name)

Generated constructor for the namespace type.

Generated constructor for the namespace type.
raw docstring

->noteclj

(->note parent name handle)

Generated constructor for the note type.

Generated constructor for the note type.
raw docstring

->platformclj

(->platform parent name)

Generated constructor for the platform type.

Generated constructor for the platform type.
raw docstring

->versionclj

(->version parent name)

Generated constructor for the version type.

Generated constructor for the version type.
raw docstring

artifact?clj

(artifact? x__5843__auto__)

Generated predicate for the artifact type.

Generated predicate for the artifact type.
raw docstring

artifacted?clj

(artifacted? t)

Predicate testing whether the input either is an artifact or has an artifact as a parent.

Predicate testing whether the input either is an artifact or has an artifact
as a parent.
raw docstring

def?clj

(def? x__5843__auto__)

Generated predicate for the def type.

Generated predicate for the def type.
raw docstring

ensure-thingclj

(ensure-thing maybe-thing)

Transformer which, if given a string, will construct a Thing (with a warning) and if given a Thing will return the Thing without modification. Intended as a guard for potentially mixed input situations.

Transformer which, if given a string, will construct a Thing (with a warning)
and if given a Thing will return the Thing without modification. Intended as a
guard for potentially mixed input situations.
raw docstring

example?clj

(example? x__5843__auto__)

Generated predicate for the example type.

Generated predicate for the example type.
raw docstring

full-uri->thingclj

(full-uri->thing uri-string)

Complement of thing->full-uri.

Complement of thing->full-uri.
raw docstring

full-uri-patternclj


group?clj

(group? x__5843__auto__)

Generated predicate for the group type.

Generated predicate for the group type.
raw docstring

grouped?clj

(grouped? t)

Predicate testing whether the input either is a group or has a group as a parent.

Predicate testing whether the input either is a group or has a group as a
parent.
raw docstring

leaf?clj

(leaf? t)

Predicate testing whether the input Thing is either an example or a note.

Predicate testing whether the input Thing is either an example or a
note.
raw docstring

namespace?clj

(namespace? x__5843__auto__)

Generated predicate for the namespace type.

Generated predicate for the namespace type.
raw docstring

namespaced?clj

(namespaced? t)

Predicate testing whether the input either is a namespace or has a namespace as a parent.

Predicate testing whether the input either is a namespace or has a namespace
as a parent.
raw docstring

note?clj

(note? x__5843__auto__)

Generated predicate for the note type.

Generated predicate for the note type.
raw docstring

parse-short-stringclj

(parse-short-string s)

Function from a String as generated by thing->short-string to one of either [:def nil nil nil <ns-name> <def-name>] or [:ns nil nil nil <ns-name>]. The intention is that this function can be used to parse short-strings into structures for which Things can be looked up out of a datastore. Returns nil on failure to parse.

Function from a String as generated by thing->short-string to one of
either [:def nil nil nil <ns-name> <def-name>] or [:ns nil nil nil
<ns-name>]. The intention is that this function can be used to parse
short-strings into structures for which Things can be looked up out of a
datastore. Returns nil on failure to parse.
raw docstring

path->thingclj

(path->thing path)

String to Thing transformer which builds a Thing tree by splitting on /. The resulting things are rooted on a Group as required by the definition of a Thing.

String to Thing transformer which builds a Thing tree by splitting on /. The
resulting things are rooted on a Group as required by the definition of a
Thing.
raw docstring

platform?clj

(platform? x__5843__auto__)

Generated predicate for the platform type.

Generated predicate for the platform type.
raw docstring

platformed?clj

(platformed? t)

Predicate testing whether the input either is a platform or has a platform as a parent.

Predicate testing whether the input either is a platform or has a platform as
a parent.
raw docstring

short-string-patternclj


thing->artifactclj

(thing->artifact t)

Function from a Thing to an Artifact. If the Thing is rooted on an Artifact, or is an Artifact, traverses thing->parent until the rooting Artifact is reached and then returns that value. Otherwise returns nil.

Function from a Thing to an Artifact. If the Thing is rooted on an Artifact,
or is an Artifact, traverses thing->parent until the rooting Artifact is
reached and then returns that value. Otherwise returns nil.
raw docstring

thing->defclj

(thing->def t)

Function from a Thing to a Def. If the Thing either is a Def or is rooted on a Def, traverses thing->parent until the rooting Def is reached and then returns that value. Otherwise returns nil.

Function from a Thing to a Def. If the Thing either is a Def or is rooted on
a Def, traverses thing->parent until the rooting Def is reached and then
returns that value. Otherwise returns nil.
raw docstring

thing->full-uriclj

(thing->full-uri t)

Function from a Thing to a String representing a unique Thing naming URI.

URIs have the same structure as thing->url-path but are prefixed by <t>: where <t> is the lower cased name of the type of the input Thing.

For example, a Thing represeting org.clojure/clojure would give the full URI grim+artifact:org.clojure/clojure. A Thing representing org.clojure/clojure/1.6.0 would likewise be grim+version:org.clojure/clojure/1.6.0 and soforth.

Function from a Thing to a String representing a unique Thing naming URI.

URIs have the same structure as thing->url-path but are prefixed by <t>:
where <t> is the lower cased name of the type of the input Thing.

For example, a Thing represeting org.clojure/clojure would give the full URI
grim+artifact:org.clojure/clojure. A Thing representing org.clojure/clojure/1.6.0
would likewise be grim+version:org.clojure/clojure/1.6.0 and soforth.
raw docstring

thing->groupclj

(thing->group t)

Function from a Thing to a Group. If the Thing is rooted on a Group, or is a Group, traverses thing->parent until a Group is produced. Otherwise returns nil.

Function from a Thing to a Group. If the Thing is rooted on a Group,
or is a Group, traverses thing->parent until a Group is produced. Otherwise
returns nil.
raw docstring

thing->nameclj

(thing->name t)

Function from an object to Maybe[String]. If the input is a thing, returns the name of the Thing. Otherwise returns nil.

Function from an object to Maybe[String]. If the input is a thing, returns
the name of the Thing. Otherwise returns nil.
raw docstring

thing->namespaceclj

(thing->namespace t)

Function from a Thing to a Namespace. If the Thing is rooted on a Platform or is a Platform traverses thing->parent until the rooting Platform is reached and then returns that value. Otherwise returns nil.

Function from a Thing to a Namespace. If the Thing is rooted on a Platform or
is a Platform traverses thing->parent until the rooting Platform is reached
and then returns that value. Otherwise returns nil.
raw docstring

thing->parentclj

(thing->parent t)

Function from any object to Maybe[Thing]. If the input is a thing, returns the parent (maybe nil) of that Thing. Otherwise returns nil.

Function from any object to Maybe[Thing]. If the input is a thing, returns
the parent (maybe nil) of that Thing. Otherwise returns nil.
raw docstring

thing->pathclj

(thing->path t)

Provides a mechanism for converting one of the Handle objects into a cannonical "path" which can be serialized, deserialized and walked back into a Handle.

Provides a mechanism for converting one of the Handle objects into a
cannonical "path" which can be serialized, deserialized and walked back into
a Handle.
raw docstring

thing->platformclj

(thing->platform t)

Function from a Thing to a Platform. If the Thing is rooted on a Platform or is a Platform traverses thing->parent until the rooting Platform is reached and then returns that value. Otherwise returns nil.

Function from a Thing to a Platform. If the Thing is rooted on a Platform or
is a Platform traverses thing->parent until the rooting Platform is reached
and then returns that value. Otherwise returns nil.
raw docstring

thing->short-stringclj

(thing->short-string t)

Function from a Thing to a String representing a mostly unique naming string.

Unlike thing->full-uri, thing->short-string will discard exact artifact, group and verison information instead giving only a URI with respect to the platform, namespace and name of a Thing.

For example, the Thing representing org.clojure/clojure/1.6.0/clj/clojure.core/+ would give the short string clj::clojure.core/+.

Function from a Thing to a String representing a mostly unique naming string.

Unlike thing->full-uri, thing->short-string will discard exact artifact, group
and verison information instead giving only a URI with respect to the
platform, namespace and name of a Thing.

For example, the Thing representing
org.clojure/clojure/1.6.0/clj/clojure.core/+ would give the short string
clj::clojure.core/+.
raw docstring

thing->type-nameclj

(thing->type-name t)

thing->url-pathclj

(thing->url-path t)
(thing->url-path t munge-fn)

Function from a Thing to a munged and URL safe Thing path

Function from a Thing to a munged and URL safe Thing path
raw docstring

thing->versionclj

(thing->version t)

Function from a Thing to a Verison. If the Thing is rooted on a Version or is a Version, traverses thing->parent until the rooting Version is reached and then returns that value. Otherwise returns nil.

Function from a Thing to a Verison. If the Thing is rooted on a Version or is
a Version, traverses thing->parent until the rooting Version is reached and
then returns that value. Otherwise returns nil.
raw docstring

thing?clj

(thing? t)

Predicate testing whether the input exists within the "thing" variant of Σ[Group, Artifact,Version, Platform, Namespace, Def]

Predicate testing whether the input exists within the "thing" variant of
Σ[Group, Artifact,Version, Platform, Namespace, Def]
raw docstring

url-path->thingclj

(url-path->thing url)

Function from a URL to a Thing. Complement of thing->url-path.

Function from a URL to a Thing. Complement of thing->url-path.
raw docstring

version?clj

(version? x__5843__auto__)

Generated predicate for the version type.

Generated predicate for the version type.
raw docstring

versioned?clj

(versioned? t)

Predicate testing whether the input exists within the subset of the "thing" variant which can be said to be "versioned" in that it is rooted on a Version instance and thus a version instance can be reached by upwards traversal.

Predicate testing whether the input exists within the subset of the "thing"
variant which can be said to be "versioned" in that it is rooted on a
Version instance and thus a version instance can be reached by upwards
traversal.
raw docstring

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

× close