September 22, 1999 | Strong Typing | Slide #30 |
val sort = fn : 'a list -> int list
How is this possible?
One way the impossible can occur is if it never can occur
``Dance with you? Yeah, when Dr. Ruth is elected president.''
``But Dr. Ruth isn't an American citizen.''
``Right!''
``When the function returns, it'll return a list of integers.''
``But it can't possibly return a list of integers.''
``Right!''
In fact, this function has a bug. It runs forever on any nonempty list.
Type Checking found an infinite loop bug!
!!
!!!!!!!!!!
Next | Copyright © 1999 M-J. Dominus |