Closed leonschoorl closed 5 years ago
Ultimately we'd like to have it solve:
(Max (((2 ^ n) + 1) + ((2 ^ n) + 1)) 1)
~ (2 + ((2 ^ n) * 2))
h :: Proxy n
-> Proxy (Max (((2 ^ n) + 1) + ((2 ^ n) + 1)) 1)
-> Proxy (2 + ((2 ^ n) * 2))
h _ = id
Which we need for (the current implementation of) the SatIndex PR: https://github.com/clash-lang/clash-compiler/pull/688
Not sure yet if the problem is with
ghc-typelits-natnormalise
orghc-typelits-extra
.In
g0
andg1
we see thattypelits-extra
can eliminateMax
s. But it seemsnatnormalise
doesn't run on the result of this eliminations ing2
andg3
.g4
shows thatnatnormalise
does seem to work underneath aMax
node.