-
Notifications
You must be signed in to change notification settings - Fork 15
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
Clean up Singletons module #31
base: master
Are you sure you want to change the base?
Conversation
src/lib/Tisch/Internal/Singletons.hs
Outdated
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
{-# LANGUAGE UndecidableInstances #-} |
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.
FWIW, the reason why I don't align these things vertically is because of what we are seeing here: When one line changes and this change shortens or widens the largest language extension name, then one needs to change all of the lines so that #-}
aligns vertically again. The same goes for imports and as
, except in imports it's even worse because one also needs to worry about how to format things when the import takes more than one line, something that looks very ugly when things are vertically aligned.
It's a small detail, but it makes maintaining and reviewing code a much pleasurable experience.
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'm sorry, this was from stylish-haskell
running automatically on save. I understand the diff problems that aligning code brings. :)
src/lib/Tisch/Internal/Singletons.hs
Outdated
infixr 3 :&&& | ||
|
||
instance SuppressUnusedWarnings (:&&&$) where |
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 don't think we need these SuppressUnusedWarnings
things. Can we remove them or do we get some warning? Also, I think you can delete all of the constructors named *KindInference
, I don't think we need those.
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.
Removing them triggers -Wunused-top-binds
warnings, which can be disabled module-locally if you'd prefer that. I'll look at the KindInference
constructors.
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.
Thanks for doing this! I added some minor comments that would be nice to address, but otherwise this looks way better than what we had 😄
@k0001 it seems I'll be able to cut this module down a lot more. |
There's something wrong:
|
It seems |
@k0001 everything should work now. |
This commit cleans up the horrible TH code in
Tisch.Internal.Singletons
somewhat.