-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use Semigroup((<>))
and define Monoid/Semigroup instances
#30
Comments
damn... I stumbled over https://mail.haskell.org/pipermail/libraries/2011-November/017066.html :-/ PS: infixl 6 <>
infixl 6 <+>
infixl 5 $$, $+$ While |
Monoid((<>))
and define Semigroup instancesSemigroup((<>))
and define Monoid/Semigroup instances
Yeah, this is an old issue that's never been resolved. I believe I took over It seems our options are:
I'm leaning towards (3) myself. It would have been nice if this had all been done at the same time as the original (1) seems annoying long-term, and (3) a slight improvement over (2). Thoughts? |
Btw, @ekmett tells me there that changing the fixity from left to right changes the asymptotics badly. Inside GHC we're considering renaming the current left-assoc operators to something else to avoid the nameclash (and confusion) with the Semigroup- More generally, I'm considering asking on libraries@ for opinions for a left-assoc alias infix-op of |
Interesting. Is this asymptotic issue explained somewhere? The previous mailing list discussion and benchmarking people had done seemed to suggest If that's the case, then yes, sadly it seems you want to retain the pretty Please let me know how GHC resolves this and if a left-assoc of |
Here's the GHC ticket btw: https://ghc.haskell.org/trac/ghc/ticket/11149 |
I'm mostly half remembering it from a comment in one of the pretty printing -Edward On Wed, Dec 2, 2015 at 4:04 AM, David Terei [email protected]
|
@dterei I've started writing up https://ghc.haskell.org/wiki/Proposal/LeftAssocSemigroupOp and I plan to put this up for discussion in a couple of days... any comments? Shall I mention the
suggestion? (of which I'm not sure what the consequences are, and ultimately it doesn't really address the subtly clashing definitions among pretty-printing libs which annoyingly don't converge on the same vocabulary in terms of associativity of |
Looks great! Thanks for writing up. Yes, it seems worth while mentioning the
To avoid conflict between |
@hvr what ever happened with this? |
@dterei still on my TODO list; hasn't been forgotten! if you want to accelerate this, please take a last look at the wiki page, and edit as you see fit! :-) In any case, I'll try to publish this to ghc-devs/libraries@ within the next 7 days EDIT/PS: For the record, here's the mailing list thread with the proposal I published back in 2016: https://mail.haskell.org/pipermail/libraries/2016-June/027074.html |
Just wanted to mention that this problem just got worse because in GHC 8.4 |
Ideally this needs to happen in time for GHC 8.0 as
pretty
is bundled with GHC 8See ekmett/ansi-wl-pprint@dd40c61 for how the
(<>)
part can be handledThe Semigroup part is a bit tricky but doable as well. I'll probably prepare a PR as that's easier than to explain how to do it =)
/cc @ekmett
The text was updated successfully, but these errors were encountered: