Mathias

 

I suspect substImplication was removed simply because it was never called, but I’m not certain.

 

The entire cloning and substitution business is very heavyweight.  Here’s an alternative idea:

 

 

That seems simple, very non-invasive, and robust.

 

Simon

 

From: Matthías Páll Gissurarson <pallm@student.chalmers.se>
Sent: 10 April 2018 00:57
To: Simon Peyton Jones <simonpj@microsoft.com>
Subject: Nested Implications

 

Greetings Simon,

I've been working on implementing the valid substitutions for typed holes in terms of nested implications, and I think I've worked out how to do it. But one thing bothers me. To use the implications that are passed along with the ReportErrCtxt, I have to clone the type variables within, to avoid having side-effects that could impact later searches. I clone the type variables and create a substitution from the old variables to the new, which I'd like to apply to the implication. When I was looking around for how to do that, I came across this code in GHC 7.6.3

https://downloads.haskell.org/~ghc/7.6-latest/docs/html/libraries/ghc-7.6.3/src/Inst.html 

The `substImplication` function does precisely what I want, i.e. applies a substitution to an implication. However, that code is no longer present in GHC 8.5! The git history doesn't go far enough back for me to find an explanation, so I wanted to ask: why was this function removed? Is there something I should be wary of if I re-implement it?

Please correct me if my approach is all wrong, I'd like to hear what you had in mind.

--

-

Matthías Páll Gissurarson