I've released a package candidate integrating katip with effectful

does withRunInIO use unliftStrategy :sweat_smile:?

Yeah.

i guess my unsafeCoerce violates some invariant of getStaticRep?

The problem is not related to effectful, it’s more general. You have unsafeCoerce (MkDict @(KatipE :> es)) :: Dict (KatipE :> es, IOE :> es), so you have a dictionary of KatipE :> es (an Int internally) and you pretend that you have dictionaries for (KatipE :> es, IOE :> es) (two IntS). unliftStrategy simply tries to use the underlying Int of IOE :> es, but it’s not there so it accesses “something” and a segfault ensues.

After giving it more thought it seems to me that the current situation in which dictionary for KatipE :> es can still be properly accessed after the coerce is a coincidental consequence of what the code gets compiled into and you should not rely on it. Not 100% sure though.