Conversation

In dependent type systems (like Idris) you can avoid these issues by parameterising data structures with the instances that are critical for maintaining internal invariants.
1