Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Change the structure of TreeFs? #371

Open
chshersh opened this issue Nov 5, 2019 · 1 comment
Open

[RFC] Change the structure of TreeFs? #371

chshersh opened this issue Nov 5, 2019 · 1 comment
Labels
question Ideas, discussions refactoring

Comments

@chshersh
Copy link
Contributor

chshersh commented Nov 5, 2019

It was proposed during the work on #333 to implement TreeFs like this:

data TreeFs
    = Dir (Map FilePath TreeFs)
    | File Text

This structure has some benefits:

  1. Automatic sorting of the tree by filepath.
  2. Eliminating duplicate FilePath cases.

The new implementation can make code more maintainable. Or can make it less maintainable. Hard to tell now. This is just a question, whether it's worth it and how should we deal with duplicate and unsorted paths. Alternative proposals are accepted as well!

@patrickt
Copy link
Contributor

Alternatively you could pull in directory-tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Ideas, discussions refactoring
Projects
None yet
Development

No branches or pull requests

2 participants