Open shriram opened 10 years ago
Equality is also part of what gets overriden on functional update.
I'm not sure how I gave you the impression that cases
was the only thing that could break (ironically, until types are checked, it's one of the few things that will still work). It's not that you shouldn't use cases, it's that you can't use instances of data with functional update and expect anything but dot to work afterwords.
This is expected behavior, and you could have really weird things count as instances of your datatype if we allowed functional update on them while preserving their datatype-ness.
Also, the error message sucks. I wonder if we should just have functional update be an error on instances of data.
I rewrote a program from constructing new instances of data to using functional update. At the back of my mind I said to myself, "Thank goodness I'm not using cases, because this will now break". I ran the program and of course it worked fine. Except I got test case failures: