Skip to content

FileData, FileAndContents, PackageFiles #4714

@B-rando1

Description

@B-rando1

Today I noticed something interesting.

data FileAndContents = FileAndContents {filePath :: FilePath, fileDoc :: Doc}

  • FileAndContents is a path and a doc

data FileData = FileD {filePath :: FilePath, fileMod :: ModData}


newtype PackageFiles = PackageFiles [(FilePath, Doc)]

  • PackageFiles is 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions