split options into optionals and optutils#10797
split options into optionals and optutils#10797narimiran wants to merge 2 commits intonim-lang:develfrom
options into optionals and optutils#10797Conversation
This is mostly work by @PMunch done in nim-lang#9160.
dom96
left a comment
There was a problem hiding this comment.
Optionals? Please please please don't make this change. I don't see a reason for renaming this module and making us all change our code.
I also don't see why those procedures should be moved to a different module, can you explain?
|
Well the module that contains the actual data type is now called |
|
@dom96 I am all in for this change, unless you have a nicer solution to shave off the Option type from it's less useful "utilities". |
So I will need to, if not today then at some point in the future because this code will get removed just like all deprecated things... Again, there is no reason to rename this module. I don't see why it's not perfectly fine to just keep the type in the current As for your arguments for splitting this file up:
Typing
With how things stand right now I don't see there being any conflict. Whether to include your changes is still debatable IMO, I think it would work in fact work better as a nimble package. |
|
That's a good point, And yeah, I will probably create a nimble package or two for my various options things. |
|
Feels like it is arbitrary what ends up in one or another module, in practice we will import both. Also it makes it harder to locate what you were looking for. This applies to sequtils vs algorithm, os vs osprosc, strutils vs strmisc, etc. Ideally every module would contain one type and related procs, in reality you have cases like sets (HashSet, OrderedSet) and intsets (IntSet), tables (Table, OrderedTable, CountTable, etc) strtabs (StringTableObj) and sharedtables (SharedTable), and cases like Option (optionals, optutils), without mentioning those things that are found in system.nim (newSeqOfcap, newSeqUninitialized, find, pop, add, etc). I read from the logs that it is hard to find things with big modules. That's true, but the real problem is that it is not possible to tell what a proc does unless you read them one by one. That problem persist after splitting modules and the side index doesn't solve this. This is how java shows a summary of the methods contained in a class which makes it easier to find what you are looking for: compared to nim: With a summary it would not matter how many procs a module contains. |
|
@Wh1teDuke that's a nice solution to this problem too and goes back to what I've said multiple times now, but I will repeat it: what you are trying to solve in this PR is a doc gen problem, not a "modules are too big" problem. |
|
Ok. |


This is mostly work by @PMunch done in #9160.