-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
[#45] Rewrite to Multiple Public Libraries #46
[#45] Rewrite to Multiple Public Libraries #46
Conversation
d202996
to
c48a96d
Compare
I've opened a bug report in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks a lot for your work, that's great 👏 I would love to see those changes 👍
I have a couple of questions though:
- Why
cabal.project
is not needed anymore? - It's actually nice that there is a central CHANGELOG but how it suppose to work for several standalone libraries?
- Could we at least move the nice refactoring parts and merge them in master now, while waiting for the bugs to be resolved?
src/readonly/Map.hsig
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a generated file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not generated. There were two signatures before: for readonly containers and for modifiable containers. But this doesn't work for some reason in this new solution. So I have only one file now, but haven't deleted old files yet. Will cleanup later 👍
update :: Key k => (a -> Maybe a) -> k -> Map k a -> Map k a | ||
delete :: Key k => k -> Map k v -> Map k v | ||
alter :: Key k => (Maybe v -> Maybe v) -> k -> Map k v -> Map k v | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we ask GitHub to highlight hsig
files as Haskell? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also would love to highlight them in my editor 🙂 But I don't know how to do this...
@vrom911 Thanks for your review! Answering your questions:
|
910ff5d
to
1108e9e
Compare
1108e9e
to
b60babb
Compare
@vrom911 This PR is ready for review! It finally builds locally, the executable is working, all tests are passing, benchmarks are running. Some highlights and summary of changes:
Any feedback is appreciated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great to see that you made it work and simplified things a lot! Well done 👍
ViewPatterns | ||
|
||
-- signatures for containers | ||
library sig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is no difference between internal libraries and libraries to export?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's my fault, turns out that all these libraries are indeed internal at the moment. To make them public, I needed to add visibility: public
field. And, again, the documentation doesn't really help here...
https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-library-visibility
https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-section-library-library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😞 we need to write more about such things in public so other people at least would be able to find these tricks easier...
test/Main.hs
Outdated
|
||
|
||
-- | ShortText is a Text with length [0, 3] chosen "arbitrarily" | ||
newtype ShortText = ShortText Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be named field unShortText
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vrom911 Yes, I guess it should be made according to our style guide. This code was written a long time ago...
test/Main.hs
Outdated
main = do | ||
Int.checkLaws (Proxy @Int) (Proxy @V) | ||
Ord.checkLaws (Proxy @K) (Proxy @V) | ||
Hash.checkLaws (Proxy @K) (Proxy @V) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we fix indentation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Sorry, too many changes, forgot to fix everything...
Note: do not make minimum larger than 0, empty texts are often edge cases. | ||
-} | ||
instance Arbitrary ShortText where | ||
arbitrary = ShortText . T.pack <$> (choose (0, 3) >>= flip vectorOf arbitrary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add the signature if possible?
c1617fc
to
a1ccb7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks for the massive work!
-- signatures for containers | ||
library sig | ||
import: common-options | ||
visibility: public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Resolves #45
This doesn't compile. I see the following parsing error with this executable stanza:
Unfortunately, this means that the interface is not usable at the moment until this bug is fixed in
cabal
. There were some other issues, like problems with having two signatures forreadonly
and not only containers, but they are solvable, and this one is show-stopper 😞However, you can have an example of how better it will become!