tweag / ghc

Fork of official GHC repository.
http://www.haskell.org/ghc/
Other
44 stars 5 forks source link

Use reduceTyFamApp_maybe in Lint #500

Open monoidal opened 4 years ago

monoidal commented 4 years ago

Currently Core Lint manually reduces multiplication of multiplicities in normalize inside ensureSubMult. Goal: change to reduceTyFamApp_maybe.

aspiwack commented 4 years ago

Maybe? Though we do want (p `MultMul` q) `MultMul` r) to normalise to the same expression as p `MultMul` (q `MultMul r). And I'm not sure we can manage this with just reduceTyFamApp_maybe, can we?

monoidal commented 4 years ago

It depends on how smart we want Lint to be. More complex properties such as associativity could be just axioms and Core would have coercions witnessing them.

aspiwack commented 4 years ago

Fair enough. I don't have strong opinion either way.