Preventing inert caching in TC plugin?

Sandy Maguire sandy at sandymaguire.me
Sat Feb 4 09:29:26 UTC 2023


Hi all,

I'm working on a little TC plugin that solves the following class:

```haskell
class KnownAnnotations where
  rawAnnotationsVal :: [Annotation]
```

Like `HasCallStack`, the result of `KnownAnnotations` is unique to each
callsite. Thus, I am trying to prevent my TC plugin from adding the
solved constraint to the inert set.

As an example, the following program:

```
t2 :: ([Annotation], Int)
t2 = (rawAnnotationsVal, test2)

t3 :: ([Annotation], Int)
t3 = (rawAnnotationsVal, test3)
```

dumps this output with `-ddump-cs-trace`:

```

Step 1[l:0,d:0] Kept as inert:
    [WD] $dKnownAnnotations_a18UB {0}:: KnownAnnotations
Step 2[l:0,d:0] Dict equal (keep inert):
    [WD] $dKnownAnnotations_a18UD {0}:: KnownAnnotations
```

Is there some trick to prevent the inert caching for these solved
wanteds?

Cheers,
Sandy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20230204/49dbd19a/attachment.sig>


More information about the ghc-devs mailing list