-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRY] what's the best way to public
ly re-export properties/structure?
#2391
Comments
Similarly, existing style seems to be to build up, definition-by-definition, towards eg ------------------------------------------------------------------------
-- Relational properties
------------------------------------------------------------------------
≋-setoid : Setoid _ _
≋-setoid = PW.setoid S
open Setoid ≋-setoid public
using ()
renaming (refl to ≋-refl; reflexive to ≋-reflexive; sym to ≋-sym; trans to ≋-trans; isEquivalence to ≋-isEquivalence) |
I'm happy to move towards the style you propose above. It does seem cleaner and more scalable. |
Let me understand if I've understood this right. The context here seems to be that some modules introduces fundamental functionality (sometimes highly parametrized), while other modules are 'actually' creating a particular view of that functionality which is better-suited for working on particular tasks (by specializing to certain parameters, but also tailoring the exports in certain ways). If that's an adequate description, then indeed this feels like a deeply pragmatic design approach. [It has the drawback that working simultaneously with the general version and the specific version can cause clashes -- but I would say that that is rare, will only be done by experts, and they ought to use qualified imports when doing that.] In other words, I too agree. (But I have started to think more deeply about that 'design' paper, even though we should knock off the JOSS one first!) |
@JacquesCarette I think your understanding is correct (but in rather different terms than I might either have first thought of this, or expressed it... ;-)). My concerns, such as they are, are two-fold:
|
Examples discussed here are tackled by #2490 but otherwise leaving the issue open as a |
Cf. #2255 of which this is somehow a generalisation ...
Thanks to the sophistication of the re-exporting strategies embodied in
Relation.Binary.Bundles
, we could streamline concrete instances of such strategies, such as inData.List.Binary.Relation.Equality.DecSetoid
.Compare the following (23 LOC; 3
import
s; 1 explicit definition; and 2public
re-exports, the first of which also introduces the correct fixity, the second shared with the existing version): UPDATED in the light of errors caught by #2490 ;-)with the existing version (31 LOC; 7
import
s; 3 explicit definitions, incl. the fixity declaration; and the 1public
re-export shared with the above).So we trade economy of expression/export for explicitness of definition... although in each case, such definitions are largely by delegation, so it's not immediately clear that there is much gain in understanding, except the documentation afforded by the types...
Which is 'better'/preferable, and which style should the library adopt from v2.* onwards?
The text was updated successfully, but these errors were encountered: