purescript-contrib / purescript-pathy

A type-safe abstraction for platform-independent file system paths.
Apache License 2.0
33 stars 17 forks source link

Add fold and biFold functions #10

Closed chrisdotcode closed 8 years ago

chrisdotcode commented 8 years ago

I should probably also update the docs. I'll do that now.

chrisdotcode commented 8 years ago

@garyb Request to remove MODULES.md, and move the docs to the standard purescript doc location? (docs/)?

garyb commented 8 years ago

Yeah definitely. We could probably switch the build to pulp too I think, and then it's just pulp docs to generate everything in the appropriate place.

chrisdotcode commented 8 years ago

I had actually used both pulp build and pulp docs just fine to both build and generate docs respectively just now.

chrisdotcode commented 8 years ago

@garyb Before you merge, should I version++, and add git tags accordingly (for bower)?

garyb commented 8 years ago

Nah, we usually make the release via GitHub anyway so it does that automatically.

chrisdotcode commented 8 years ago

@garyb Ready for merging, then?

garyb commented 8 years ago

Could you squash the commits please? And then :+1:

chrisdotcode commented 8 years ago

@garyb Do you want one single commit, or do you want me to try and preserve the code changes/documentation changes if and where possible?

garyb commented 8 years ago

We tend to just squash into one commit unless the change is huge :wink:

I'll leave the final merging to @jdegoes though, given he has ideas about how the fold should work.

jdegoes commented 8 years ago

I feel this version of fold is easy to misuse: for example, if I try to construct a path string by folding over the path, then the resulting path will be inaccurate because it fails to take into account ../foo/../bar/ (ParentIn) nodes. I would be open to (a) fixing this issue, or (b) renaming it foldNames and making sure the documentation is clear it will fold only over the file and dir names, not all the nodes making up the path.

chrisdotcode commented 8 years ago

@jdegoes How about exposing the constructors in some way, shape or form, like in your example above?

jdegoes commented 8 years ago

Thanks so much for this @chrisdotcode!

jdegoes commented 8 years ago

Oops, accidentally merged this prior to the final revision! Sorry. :disappointed: