Generate .show / (==) methods for user datatypes. One issue is that compile time type errors are pretty terrible to work with since there are no source locations to point to for generated methods, so if there is a missing method for a nested type that the user is using they will get strange errors that happen at unification time instead of when the methods are generated.
Handles type parameters fine & recursive datatypes / datatypes with functions.
Happy to do some additional defensive programming and remove support unless a user annotates a type. It seems like it might be hard foresee all of the various problems that might occur, but it probably isn't as bad as I think. I've already covered only considering value kinded type arguments, and ignoring effects / other kind arguments.
Finally I think a primitive pointer equivalence check might be good to optimize the equality a tiny bit.
Generate .show / (==) methods for user datatypes. One issue is that compile time type errors are pretty terrible to work with since there are no source locations to point to for generated methods, so if there is a missing method for a nested type that the user is using they will get strange errors that happen at unification time instead of when the methods are generated.
Handles type parameters fine & recursive datatypes / datatypes with functions.
Happy to do some additional defensive programming and remove support unless a user annotates a type. It seems like it might be hard foresee all of the various problems that might occur, but it probably isn't as bad as I think. I've already covered only considering value kinded type arguments, and ignoring effects / other kind arguments.
Finally I think a primitive pointer equivalence check might be good to optimize the equality a tiny bit.