<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">My instinct is the same as Richard's. I had a quick look at the paper and didn't immediately grok how to use it for finite maps. <br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
Still, in the TTG work we are slowly adding more static checking to GHC's code, and the O/C stuff in Hoopl is another example. And perhaps you may find a sweet spot? Feel free to have a try, so we can evaluate whether the cost (in understanding what's going on) is worth the benefit. <br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 25 Mar 2022 at 19:26, Richard Eisenberg <<a href="mailto:lists@richarde.dev">lists@richarde.dev</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">I've tried once or twice to introduce more static checking in the GHC source code. My limited experience with this is that the effort is large, and the payoff small. Maybe your experience will be different -- I haven't tried the particular technique in that paper -- but I probably wouldn't personally invest much energy in this direction.<br>
<br>
Richard<br>
<br>
> On Mar 22, 2022, at 2:10 PM, Norman Ramsey <<a href="mailto:nr@cs.tufts.edu" target="_blank">nr@cs.tufts.edu</a>> wrote:<br>
> <br>
> A blog post of lexi-lambda's recently put me onto Matt Noonan's<br>
> technique "Ghosts of Departed Proofs" [1], which appeared in the 2018<br>
> Haskell Symposium. One example that intrigued me was a safe `Map`,<br>
> which uses the type system to guarantee that lookup does not fail.<br>
> Maps are used pretty extensively in Cmm-land; for example, I recently<br>
> have been using them to get information like the dominator set or the<br>
> reverse postorder number of every node in a `CmmGraph`. In these<br>
> maps, every `Label` that appears in the `CmmGraph` is expected to have<br>
> an entry. For the moment, I am just using the standard lookup<br>
> function; if an entry should be missing, my code calls `panic`.<br>
> The idea of eliminating these calls and getting compile-time type<br>
> safety is intriguing, but I'm not sure the game is worth the candle.<br>
> <br>
> What do other GHC devs think?<br>
> <br>
> <br>
> Norman<br>
> <br>
> <br>
> <br>
> <br>
> [1] <a href="https://iohk.io/en/research/library/papers/ghosts-of-departed-proofsfunctional-pearls/" rel="noreferrer" target="_blank">https://iohk.io/en/research/library/papers/ghosts-of-departed-proofsfunctional-pearls/</a><br>
> _______________________________________________<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>
<br>
_______________________________________________<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>