Drasil
Drasil copied to clipboard
`Idea` typeclass: What?
A chunk that satisfies Idea means that it might have an abbreviation and is also named (via the NamedIdea constraint, which says that the chunk has an NP ["the 'term' being defined by this chunk"]).
Commentary:
- DataDefinition` satisfies it, implying it might have an abbreviation. While I don't have any issue with that, the abbreviation instance refers to the abbreviation of the quantity being defined by the DD. That seems wrong. ModelKinds, TM, GD, and IM too.
-
Quantityis a constraint that wraps togetherIdea,HasSpace, andHasSymbol, but I don't quite see whyIdeais involved rather thanNamedIdea.
Now, two questions:
- Following the wiki, should we rename
IdeatoMayHaveAbbreviation? - Recall that we want to stop nesting chunks. With
NamedIdea,Ideais effectively a classy lens forIdeaDict(a record pairing a UID, noun phrase [a term being declared] andMaybean abbreviation). Many chunks currently still "extend"IdeaDicts (e.g., they carry an entireIdeaDictwithin them, from which they get theirUID, term/name, andMaybeabbreviation).QuantityDictis one such example, and itsIdea+NamedIdeainstances are immediately reliant on the internalIdeaDict. Assuming we want to inch further towards not nesting chunks, theQuantityDicthas its ownUIDand would only contain a reference toIdeaDict(via a typedUIDreference). ShouldIdeaandNamedIdeastill be instantiated forQuantityif this happens? Or should they be replaced with an instance of a hypothetical typeclassGivesStructureTothat points towards theIdeaDict(viaUID) rather than giving the data from theIdeaDict?
I suppose (2) belongs to a broader question of: What is going to happen to all of our lenses that are defined purely by "deferring to the instance of some internally held chunk" as well?
To make real progress, I think we first need to answer:
- What is an abbreviation?
- How do we use abbreviations?
- Are each of these uses correct?
- Are there places where abbreviations are mandatory?
- The answer to 2 will help figure out what's going on with DD, ModelKinds, TM, GD and IM. Indeed the 'abbreviation for what' is the key question in those cases
- Again, I think the answer will lie in use-site code, i.e. where is the abbreviation for a
Quantityused
On the two questions:
- Perhaps. But only after the 4 steps above have been done.
- Again, I think the 4 questions will help. Do we ever use the
Idea+NamedIdealenses associated to aQuantityDict? Maybe we don't! That would let us cleanly remove those instances, which would be progress. Easy enough to test.