haskellari / strict

8 stars 7 forks source link

Change fixity of :!: #10

Closed phadej closed 4 years ago

phadej commented 4 years ago

It's currently left-associative, which I find confusing. E.g. Agda has right associative _,_ operator.

I think it would be better to have non-associative operator, i.e. not left, nor right.

infix 2 :!:

The meaning of

'a' :!: 'b' :!: 'c'

is unclear (but if something have to be picked, I'd pick right associativity, i.e. 'a' :!: ('b' :!: 'c')

infinity0 commented 4 years ago

Since (,) is non-associative, I think non-associative makes sense here. This will break rdeps though.

infinity0 commented 4 years ago

https://packdeps.haskellers.com/reverse/strict

Is there a tool to check how much breakage there will be? I seem to remember people talking about this sort of thing on some other large libraries.

phadej commented 4 years ago

Not fixing something, because it would break someone is a lousy argument. The breakage in this case would be very easy to fix in backward-compatible way. People will notice it when they relax upper bounds.

infinity0 commented 4 years ago

I didn't argue against fixing it - I just want to see how much breakage there would be. If it's large-scale then we can look into automating generating patches, rather than leaving everyone to figure it out for themselves. (I've seen tools for that elsewhere, not sure if they exist for Haskell / the existing ones work for Haskell.)

Also the benefit here is fairly minor so thinking about cost-benefit tradeoffs is prudent, not everything has to be perfect in the real world.

infinity0 commented 4 years ago

e.g. https://github.com/cdepillabout/nix-reverse-deps-of-haskell-package might work, once I find some time to update my nix again.

infinity0 commented 4 years ago

Ok, I ran some tests. There around 90 revdeps in nix, out of 107 total. Of the 90, most of them are broken in some other way - generally they didn't update base yet or something else important. That leaves 15 revdeps successfully built, that aren't affected by the change in fixity:

ADPfusion-0.6.0.0
Hclip-3.0.0.4
NaturalSort-0.2.1
adblock2privoxy-2.0.1
ascii-art-to-unicode-0.1.0.1
brittany-0.12.1.1
cabal-bounds-2.3.0
cabal-lenses-0.10.1
cookbook-3.0.1.1
hspec-stack-rerun-0.1.0.3
matterhorn-50200.9.0
mediawiki2latex-7.33
ruff-0.4.0.1
stylish-haskell-0.11.0.0
yeganesh-2.5

So I'll just go ahead and merge this change and we can have it in 0.4.

infinity0 commented 4 years ago

treemap is broken by our extra instances, since it defines its own instances. strict-data does use :!: but is broken due to util-plus being broken.

So not many things; they can all deal with it themselves.

phadej commented 4 years ago

@infinity0 great news. This makes strict ready to be released. I'll tell that in aeson PR.