-
Notifications
You must be signed in to change notification settings - Fork 26
Attributes of Data Types
drasil-bot edited this page Jun 13, 2024
·
5 revisions
Warning: Wiki should not be edited directly. Edit the files in the ./wiki/ folder instead and make a PR.
Note: The material in this page is likely all obsolete, and will be deleted at some point.
Branching from Issue #514, it seems as though an attributes field should not necessarily be added to all data types. For example, looking at how types are defined as of commit eef8b385 in Constrained.hs, the following description should be kept in mind:
-
ConstrainedChunk
,ConstrConcept
(andQuantityDict
) are all data-structures. We want to abstract over these as much as possible (which, in Haskell, is quite a lot). But, for sure, the constructor for them is not exported. -
cuc'
,constrained'
andconstrainedNRV'
are all "smart constructors". They are not necessarily that 'smart', but what they do is give you a way to build commonly occurring cases in ways that should be more convenient than using the raw constructor. Of coursecuc'
is not particularly convenient... but that's a different issue. - These data-structures store some data. They happen to be implemented as nested records. They could be implemented as 'flat' records, as tuples, etc. We want to not care about these details.
- As
ConstrainedChunk
already has a field for attributes, we don't want to add a second one. Same for the other data-structures. - This means that when we build these things, we have two situations that arise:
- we're building something "from scratch". Then we want to set the attributes.
- we're build something from a pre-existing chunk. Then we want to add to the attributes.
- In the latter case, we have to make sure that the extra information does not somehow contradict what was there before. But this should not happen, because the chunks have the same
uid
. What this means, to us, but not enforced by the code, is that all chunks with the sameuid
should in fact be about the exact same thing. So adding new attributes is merely incremental building, rather than actual modification.
- Home
- Getting Started
- Documentation (of Drasil specifics)
- Design
-
Readings
- Drasil Papers and Documents
- Related Work and Inspiration
- Writing Documentation
- Compression as a Means to Learn Structure
- Glossary, Taxonomy, Ontology
- Grounded Theory
- Model Driven Scrapbook
- Model Transformation Languages
- ODE Definitions
- The Code Generator
- Suggested Reading
- Sustainability
- Productivity
- Reuse
- Formal Concept Analysis
- Generative Programming
- Software Documentation
- Units and Quantities
- Misc.
- WIP Projects