In ML it doesn’t work
- fun find pred nil = false
| find pred (x::xs) =
if pred x then x else find pred xs;
val find = fn : (bool->bool) -> bool list -> bool
- find is_positive [~3,3,5];
...type error...
Previous slide
Next slide
Back to first slide
View graphic version