Closed mikesol closed 2 years ago
I'm ok either way. What do you think would be the most standard way for this in Purescript? Currently all the Operators are in one big file (there are other files for helper stuff).
For util libraries like Simple.JSON
and Aviary.Birds
, the standard is one big file, but in those cases, everything is in one file and the util methods are not exposed to the outside.
Here, even though it's unconventional, I'd recommend all the util stuff in separate files. For logical clumps like ST or DisposingRef or Rx compat, it makes sense for them to remain clumped together as they currently are.
But otherwise I'd create separate files, ie BlockingGetN.purs
, FromEffect.purs
, FromAff.purs
, FromCallable.purs
and then re-export everything in one top-level file. For example, if I were browsing the repo and saw BlockingGetN.purs
, I'd understand quickly what's going on because the name of the function & file is clear, whereas if it were in AffBridge.purs
, I may not find it because I don't know where to look. Perhaps all of this would go under an FRP
folder.
How does this sound?
Sounds good to me. Will move everything to separate files then!
@mikesol just to confirm: The file and the function will have the same name i.e.: Paraglider.Operator.CombineFold.combineFold
, right?
Do you have some neat way to move methods and rename files for PS projects, or is it all manual?
I think a nice structure for this repo could be a very flat one of minimalistic functions, each of which does one thing and is clearly documented.
For example,
memoBeh
(or whatever we name it) would be it's own file,mailboxed
(which we could move here fromhyrule
) could be its own file, thefireAndForget
could be its own file,take
could be its own file, etc. This is because there is no "logic" to the toolbox - when we are reaching for any one of these, we don't think "memoBeh
is from the X family of functions which is in file Y." We just wantmemoBeh
, and if it's inMemoBeh.purs
, we're done looking.Another possibility would be to do one gigantic file, which is what's done in
birds
and works quite well. However, the issue withhyrule
, is that the implementations can get quite large, so the file easily could get unwieldy.How does that sound?