Closed soenkehahn closed 10 years ago
Fixes #27.
Please wait, still working on this.
Ok, now this would be ready for merging (pending travis approval). The last four commits are rather meant as propositions as basis for discussion. cc: @alpmestan @jkarni
Ideally, we would have two Utils
-like super-modules:
S.Utils.Text
, .Req
and .BaseUrl
).servant
core (currently S.Utils.ApiQuasiQuoting
and .Links
).Do you think this division is important? If yes, any ideas for good names?
Something that's related came up, namely that we are starting to have invariants that can only be guaranteed if certain things aren't exported. So I propose an Internal
dir . Then, unless it you think it wrongly indicates a connection between the two, we could have the first Utils
be inside of Internal
, and the second outside.
I thought about that, too, but I don't think it's a perfect solution, as some things from these internal utilities modules will end up in the public API. (E.g. FromText
.) And that's confusing: we have an Internal
module and encourage people not to import that and then we re-export stuff from it in the normal external API. (But maybe that's not that problematic.)
(I do however think that an Internal
module is the right solution for your problem with invariants.)
What do you think about having Utils
(for Links
and ApiQuasiQuoting
) and CoreUtils
(for BaseUrl
, Req
and Text
)?
LGTM, modulo whatever we decide about the module-renaming. I think the organization you picked is good though - if we need to, we can change it again later.
Right - Internal
may be best left for things that should never be imported in client code.
Maybe Common
(for BaseUrl
etc) vs Utils
? Either sound good.
Yes, Common
, I like that. Will update this PR.
Internal
for things that are not meant to be exposed sounds good. Common
should be fine for the other, unless it starts getting bloated, in which case we may want to subdivide further. I do hope however that most of the time people won't have to worry about this and will just import Servant
:)
Agreed.
Ok, finally good to merge.
Can I merge safely now?
Yes, should be good.
Please review and merge.