-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix J.Tibell style for record syntax: add line before '}' #4
Conversation
Good fix! I'd only tested it with comments which auto-inserts the newline. |
Hi, I would like to open an issue about the lack of composability of the current "API" but issues are closed :-( For instance what is the best way to reuse your formatting for function signature in another style (such a Tibell that doesn't currently case on function signature). Looking at how @ocharles is achieving this same goal, you can see that it is not optimal. On the other, copy-paste is not great either. |
@PierreR There are two options:
In the first choice, you can still customize the behaviour by extending sub-node-types. I may prefer the latter choice because I do not want people relying on behaviour in my |
(You're free to make a PR that exports any function from my |
So this gives a nice compare view that makes clear what @ocharles is doing. ocharles/hindent@chrisdone:master...master To re-use your definition of TypeSig, I can copy-paste it or doing something analog to what @ocharles is doing The first case is easy. I can do a PR immediately but the copy/paste approach will quickly go out of hand. In a way I am wondering how @ocharles would submit a PR for his style. I would be happy to submit a PR but I feel there is a need to give some thought to the matter. Cheers |
@ocharles has his own fork that imports the whole I don't see any need for module encapsulation in |
Yes, thanks for your feedback. That was my first try. What worries me is the fact that |
I think things should have explicit import lists, but explicit export lists is just annoying (in this scenario). |
I'm fine with this approach.
We need a process, though. Consider the following scenario:
Note: This is unlike the fundamental style defined in What do I do at this point? Thanks to @gibiansky, we now have a test suite. So I can theoretically know when I've broken someone else's style. I think it can be like this:
Sound good? I don't think it should happen that often and it's not the end of the world, but we're busy people so it's good to know a clear way forward in that situation. Also if some combinators seem to have nothing to do with the style in question it would ideally be moved into |
Of course, all that is assuming you guys want to share your styles, it's also possible to just have a local XMonad-like project that imports HIndent and your style. That's less maintenance burden for yourself. I think it's cool to have everyone in one place a la XMonad Contrib that users can choose simply, but just mentioning that's also an option. |
I think that three step process is perfect. I'm trading a little time upfront now for potentially spending time in the future that you change how you want to do things. There's a gamble, and I should be the one paying that price if the odds stop falling in my favour. I'm all for having a repository of common themes, ultimately I'd like to be able to tell contributors to my projects to use my style - that's much easier if they just need to |
Good stuff. @PierreR also happy?
Indeed, agreed. That's definitely the ideal use-case. |
Sound great to me. Do you want me to submit a PR that removes module encapsulation at least for your Style or shall I let you do that ? As a note, ideally I wish I would have a kind of picture to quickly see how one style fits my taste better. Personally I have no interest in developing my own style and ultimately want to pick the one that most people would use. |
@PierreR I've explicitly imported style names in
To see which one fits your taste better you can just pass
So do you want a style that fits your tastes or one that's popular? Make up your mind! ;-) |
I would be happy with a kind of I am pretty sure there will be different styles for Haskell (but hopefully not too many). So now I need to pick one (hence the taste bit ;-)
Passing Thanks for your input. |
There are a set of test cases for the As an aside, I agree that having a reasonable "default" style is preferable, which would make |
https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md