Open jllang opened 3 years ago
Changing the Leaf
case return value to undefined
fixes the error, but I feel like that's not the best way to solve this.
Ah, there seems to be a link to another chapter that supposedly helps to fix the problem with delmin
. The link doesn't work for me, though.
The function
delmin
in Chapter 5.3 seems to have a problem. I get the following error:I tried adding this specification
{-@ delMin :: (Ord a) => u : {t : BST | t /= Leaf} -> MinPair a @-}
but it didn't help. With this specification, I get the following error message:It seems to me that the problem is when
delmin
is applied toLeaf
, so it feels natural to require that theBST
we're applyingdelmin
to cannot be a leaf. Why is this specification rejected?