Drasil
Drasil copied to clipboard
Use concepts for field names
In #3389, it was noted that we hardcode a bunch of field names as strings instead of using their associated concepts, which should be fixed.
https://github.com/JacquesCarette/Drasil/blob/3725db2ce30e5eb47c0ba9f93f96549d4f61ea21/code/drasil-docLang/lib/Drasil/DocumentLanguage/Definitions.hs#L216-L229
Note that simply mapping from a Sentence
to a String
is a code smell, so some other solution should be developed.
Similar to what was done by @harmanpreet-sagar in #3389, we might also need to do the same with all of those other raw Strings too.
@samm82 is there any way to convert a NamedIdea
to a String
I know phrase
can be used to get a Sentence
but I did not find a way to convert that to a string.
I can't find the specific comment, but @JacquesCarette previously told me that trying to extract a String
from a Sentence
(or something that has a Sentence
) is a hack and indicates that there is something weird going on at the design level. My guess is that if we want to reuse concepts for the names of the fields, we won't be able to use the Show
instance for the class. This is similar to what @balacij suggested in this comment: "we should try to remove the Show
instance and see what breaks".
Right: wherever you encounter this, probably the issue is that whoever wants a String
should want a Sentence
instead. Well, 80% of the time. So the details of the situation matter, to find those other 20%.
Refer to #3455 for progress on this issue