Create a `ChunkDB` that all case studies import and add to.
Code Duplication
Look at these examples:
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/ssp/lib/Drasil/SSP/Body.hs#L153-L163
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/hghc/lib/Drasil/HGHC/Body.hs#L63-L67
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/swhs/lib/Drasil/SWHS/Body.hs#L107-L116
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/dblpend/lib/Drasil/DblPend/Body.hs#L144-L152
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/glassbr/lib/Drasil/GlassBR/Body.hs#L134-L143
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/sglpend/lib/Drasil/SglPend/Body.hs#L132-L140
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/template/lib/Drasil/Template/Body.hs#L108-L114
Goal
Each of our case studies have a basic set of chunks that we seem to always add to the ChunkDB for all of our case studies. The goal of this issue is to reduce the amount of duplication between ChunkDBs.
Solution
We can do this in at least two ways:
- Create a
ChunkDBcontaining much of the stuff we import in at least 2 of our case studies, and use that as a basis for our othercdbs. - Create a
cdbWCommonsfunction that wrapscdbby injecting the same common imports to the relevant lists before also usingcdbto create theChunkDB.
I found something that already does something similar to (1), could we build on this?
https://github.com/JacquesCarette/Drasil/blob/196370e5a3ca95d9be69f9155f6c664dda897f5a/code/drasil-example/template/lib/Drasil/Template/Body.hs#L108-L114 I'm not sure if drasil-example/template is meant to be accessed at all but the code could at least be copied to somewhere more appropriate @balacij
Good find @jackwyand
We should first analyze what's going on with the pattern. Is it all meta-information? If so, then clearly we should abstract it out. In a way, that information should always be present even in an empty ChunkDB! It's like our Prelude.