Introducing "Time"

Great work, this looks awesome @davedelong. Just a few comments

  • this hogs the Time module name, ie. it'll clash with anything that has a module called Time, exported, not exported, private, public, .... Similarly, it takes the time URL component and the Time package name, all of those have to be unique in a whole package graph as of today :frowning:. This package will probably be in conflict with many other packages revealed in this github search. For the SSWG we therefore require some uniqueness, see for example here.
  • Time exports public types like Value, I'd probably recommend prefixing at least Value because it's such a generic name
  • For your own benefit, I would recommend not making your Error types public enums. The language dialect that is used in Swift packages means that all enums are exhaustive so won't be able to add an enum case without making a new major SemVer version :frowning:. We messed that up in SwiftNIO and are suffering quite frequently, we intend to fix this for NIO 3 which is a long time out though. I'd recommend using public struct SomethingError like in this example assuming you don't need associated values. If you do need associated values, then your best shot is probably creating public enum TimeErrors {} and nesting all errors as types in there?
  • regarding public API of a package that I'd expect to be widely used, you might want to check the SwiftNIO docs regarding public API, maybe you get some inspiration.
6 Likes