implementation $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#implementation">#
In this documentation we discuss how one implements our systematics in the f-utils
framework.
entities $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#entities" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#entities'">#
In f-utils
, we will deal with f-system
that have four kinds of entities:
types
: are the types that can be passed to (or returned by) a function;operations
: are functions that receive types and return another types, i.e., are ways to build new types from given ones;spectra
: are the “generic functions”, which implements parametric polymorphisms, hence that can be applied to different types;dynamic spectra
: are the variations of spectra that deals with variable generic functions, in the sense that they can have a variable number of objects.
classes $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#classes" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#classes'">#
Each kind of entity is an object of a class, which comes endowed with an alias:
class alias entities
--------------------------------------
Types t types
Ops o operations
Spec s spectra
DSpec ds dynamic spectra
methods $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#methods" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#methods'">#
The structural operations on the entities are implemented as methods in the corresponding classes.
method meaning
-------------------------------------------------------------------------------------
Types.database() initialize a Types database
Ops.init() initialize an operation in some Ops database
Spec.add() add some metadata to some spectra in some Spec database
DSpec.update() update some info of some dynamic spectra in some DSpec database
state $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#state" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#state'">#
The state of an entity is given by a dictionary entry, which contains the metadata part and a specialized data part.
For example, for operations in Ops
:
some_ops: {
metadata: {
desc: "some description",
tags: ["tag1", "tag2", ...],
comments: ["comment 1", "comment 2", ...]
},
op: {
func: some_function,
repr: human_readable_reprentation_of_some_function
}
}
database $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#database" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#database'">#
Our databases are just class-level dictionaries containing the states (i.e, the dictionary entries) of the entities.
For example, for Ops
:
some_Ops_dict = {
some_ops: {
metadata: {
desc: "some description",
tags: ["tag1", "tag2", ...],
comments: ["comment 1", "comment 2", ...]
},
op: {
func: some_function,
repr: human_readable_reprentation_of_some_function
}
},
...
}