-
Notifications
You must be signed in to change notification settings - Fork 33
Reorganising node-fs and node-fs-aff #19
Copy link
Copy link
Closed
Labels
purs-0.15A reminder to address this issue or merge this PR before we release PureScript v0.15.0A reminder to address this issue or merge this PR before we release PureScript v0.15.0type: breaking changeA change that requires a major version bump.A change that requires a major version bump.
Metadata
Metadata
Assignees
Labels
purs-0.15A reminder to address this issue or merge this PR before we release PureScript v0.15.0A reminder to address this issue or merge this PR before we release PureScript v0.15.0type: breaking changeA change that requires a major version bump.A change that requires a major version bump.
/cc @felixSchl
I think the current situation with
purescript-node-fsandpurescript-node-fs-affis less than ideal. Some thoughts:node-fs, in many ways, is a low-level FFI binding to Node.js'fsmodule. However, it has some high-level features, egPerms,Encoding.node-fs-affis a higher-level library thannode-fs, but only in one way as far as I can tell (i.e. it usesaff)type FilePath = Stringhas no place in a high-level filesystem library. In a high-level filesystem library, we should be using something like purescript-pathy for paths.I propose that we merge both of these into one library (purescript-filesystem?) with separate high-level and low-level parts. The low-level parts should closely mirror node's
fsmodule, useStringfor everything, and returnEffactions, while the high-level parts should be designed first and foremost in a way that makes sense and is easy to use, should use proper types likePerms,Encoding, andPath, and returnAffactions.If there's a need for it, we can break out the low-level parts into a separate library.
It also might be a good time to think about how to deal with other backends. Preferably the high-level library would be able to support backends other than node.js. (Perhaps free monads would be a good fit for enabling this?)