<div dir="ltr"><div>so i did some poking around see eg <a href="https://gitlab.haskell.org/ghc/ghc/blob/4898df1cc25132dc9e2599d4fa4e1bbc9423cda5/compiler/basicTypes/BasicTypes.hs#L1187-1207">https://gitlab.haskell.org/ghc/ghc/blob/4898df1cc25132dc9e2599d4fa4e1bbc9423cda5/compiler/basicTypes/BasicTypes.hs#L1187-1207</a></div><div>, and at the moment, the simplifier phase number ordering internally (in order from first to last)<br></div><div><br></div><div>"Initial phase" --- essentially positive infinity</div><div>.... -- currently we can add new phases here<br></div><div>2 <br></div><div>1</div><div>0<br></div><div><br></div><div>-------</div><div>This actually surprised me, as i've always (at least from how rules are usually written in eg vector) thought it was counting UP! <br></div><div><br></div><div>@Christiaan ... so we'd need a Pre initial phase count? that happens before Initial phase?<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 6, 2020 at 10:22 AM Christiaan Baaij <<a href="mailto:christiaan.baaij@gmail.com">christiaan.baaij@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>The other day I was experimenting with RULES and got this warning:</div><div><br></div><div>src/Clash/Sized/Vector.hs:2159:11: warning: [-Winline-rule-shadowing]<br> Rule "map Pack" may never fire<br> because rule "Class op pack" for ‘pack’ might fire first<br> Probable fix: add phase [n] or [~n] to the competing rule<br> |<br>2159 | {-# RULES "map Pack" map pack = id #-}</div><div><br></div><div>The warning seems to suggests two things:</div><div>1. "Class op" -> "dictionary projection" are implemented as rewrite rules and executed the same way as other user-defined RULES<br></div><div>2. These rules run first, and you cannot run anything before them</div><div><br></div><div>Now my question is, is 1. actually true? or is that warning just a (white) lie?</div><div>If 1. is actually true, would there be any objections to adding a "-1" phase: where RULES specified to start from phase "-1" onward fire before any of the Class op rules.</div><div>I'm quite willing to implement the above if A) Class op rules are actually implemented as builtin RULES; B) there a no objections to this "-1" phase.</div><div><br></div><div>Thanks,</div><div>Christiaan<br></div><div><br></div></div>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>