Am 23.03.26 um 01:09 schrieb Albert Y. C. Lai:
Perhaps
DirectoryConfig<C> { Pair<Path,C> path Pair<String,C> file }
Context { String filename int lineNumber, columnNumber }
Pair is a 2-tuple type.
Unit is an informationless type.
Then you can have DirectoryConfig<Context> and DirectoryConfig<Unit>.
Assuming directoryConfig is a variable of type DirectoryConfig, I'd have to access the values as directoryConfig.path.first, so that's not an improvement over directoryConfig.path.value. It does hide the context information; how would I map from a DirectoryConfig<Context> to a DirectoryConfig<Unit>? The data structure is deeply nested; there's a List<DirectoryConfig> children in each DirectoryConfig, and the whole thing is inside a SiteConfig which in turn is inside a GlobalConfig, so it's not just hierarchical but heterogenously nested. Regards, Jo