-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
Today I noticed something interesting.
| data FileAndContents = FileAndContents {filePath :: FilePath, fileDoc :: Doc} |
FileAndContentsis a path and a doc
| data FileData = FileD {filePath :: FilePath, fileMod :: ModData} |
FileDatais a path and aModDatadata ModData = MD {name :: String, modDoc :: Doc} ModDatais a name and a doc
- So
FileDatais a subtype ofFileAndContents, modulo some isomorphism
| newtype PackageFiles = PackageFiles [(FilePath, Doc)] |
PackageFilesis a list of pairs of path and doc- So essentially a list of
FileAndContents, modulo some isomorphism
I feel like at least one of these types is unnecessary! From an in-person chat with @JacquesCarette, PackageFiles is on the chopping block. I think it still makes sense to keep FileAndContents as the type containing the subset of FileData that drasil-code needs.
Beyond that, consolidatePackageFiles is doing some silly things and can be removed or at least heavily reduced. Most of the other functions in that file are likely unnecessary as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels