Pharo Smalltalk has a feature where you can find methods by giving an example of the input and output you expect. Forget how to uppercase a string? Just write:
'eureka' . 'EUREKA'
and the IDE will suggest the method asUppercase.
It does this by dynamically invoking all of string's methods until it finds one whose output matches!
Neat, but not generalizable because methods often have side effects. You could easily know when this search is safe in a language that types side-effects, like Haskell. So types can enhance this feature too.
On a fully dynamic type system, static analysis can't know what functions accept strings. It would have to try every single function, what is not viable, because many have side effects.
Pharo Smalltalk has a feature where you can find methods by giving an example of the input and output you expect. Forget how to uppercase a string? Just write:
and the IDE will suggest the method asUppercase.It does this by dynamically invoking all of string's methods until it finds one whose output matches!