3 ms·
Uh so how do you debug linearly typed code if you can’t log values? Or does ghc allow to cheat?
by baq 6y ago
Uh so how do you debug linearly typed code if you can’t log values? Or does ghc allow to cheat?
- masklinn 6y agoI don't know if GHC provides either, but either a borrowing or a dup feature would handle that (the latter would probably count as "cheat"). There may be other ways as well. Since linear types are a separate opt-in feature you'd probably need (as far as I understand) you'd need separate printers anyway, so you could probably "cheat" them in. Though I think the sort of structures you'd want to be linear would generally not be amenable to print-debugging anyway.