[Haskell-cafe] Explicitly calling syntactic equality on datatypes

Juan Casanova juan.casanova at ed.ac.uk
Wed Sep 18 21:44:40 UTC 2019

> (1) The normalized values form a sub-set of the general ones. If you  
> have just one data type for both, then you'll have no static  
> guarantee of normalization, and this will lead to mistakes once you  
> fail to track the normalize calls.

I think this summarizes why we are thinking different things. I  
realize that "normalization" is a strong term, but do remember I was  
using this as an example (in my real example it is a form of  
normalization as well, though). The main thing is that, normalization  
or however you call it is *not* a main feature of my program. At least  
not right now. If it were, I'd agree with you that two separate types  
would be the way to go, and it might in the future.

But, it is conceivable that this process is just a way to check  
equality, and that small operations that are not omnipresent in the  
rest of the program to be performed before syntactic equality is a  
pretty usual situation when checking equality for certain types.  
Therefore, forcing the user to re-implement syntactic equality every  
one of those times, specially when the compiler already knows how to  
do this, seems weird.

In short, I agree with you that if the concept of normalization is  
important, separating the types is the right way to go. But this was  
not the main focus of my original post. I was more interested in  
saying: there is a small unimportant operation to be performed before  
checking equality, and thi sis forcing me to reimplement the entire  


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

More information about the Haskell-Cafe mailing list