I have a question, what does "hd []" evaluate to? Actually I am trying to prove something like "x ∉ (hd ([]))"
The head of the empty list is unspecified. Therefore, you can’t prove anything about it except for things that hold for any value of the respective type. For example, you can prove that hd [] :: bool
is either False
or True
, but you can’t, for example, prove that hd [] :: 'a set
is the empty set, because it could be any set.
Thanks!
The worst example I ever had was a case where hd [] = hd []
was not provable
this is always true… unless there is some implicit conversion going on
hd ([]::real list) = hd ([] :: nat list)
Implicit conversions considered harmful?
well there can be very useful
it just took me a while to figure out how the typing and the implicit conversion was hurting me in that case
Last updated: Dec 21 2024 at 12:33 UTC