[Haskell-cafe] (Feeling that) GHCi is trying to protect me from myself with overlapping instances and existential types

Juan Casanova juan.casanova at ed.ac.uk
Sun Feb 16 21:04:06 UTC 2020


> Suddenly the semantics of Alice's function changes, she gets useFoo  
> a = Left a without any changes in her own code!

That's not what would happen with my originally proposed behaviour. It  
would suddenly not compile, because in that case there are, in fact,  
two instances that do match all the way through. It's not the same as  
my original code.

But that is just a punctualization aside from all the things I already  
accepted about the potential problems my solution could indeed fact,  
and more importantly that I had totally misunderstood how overlapping  
instances were meant to be used in principle.



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




More information about the Haskell-Cafe mailing list