I think that if you look at things from a more general level, you can observe the natural connection between static typing and lazy functional languages. The main point of static types is to inform and promote the compiler; exploring the static-dynamic separation between languages, it usually tracks the split between compiled and interpreted code.
And what is the meaning of lazy assessment?
The notorious retrospective article by Payton-Jones et al. Describes a lazy rating as a “hair shirt” that keeps the tongue purely functional. His metaphor aptly conveys the Haskell community to the deep-rooted idealism of denotational semantics. A non-standard assessment of the fundamental benefit lies in the fact that it transforms the possibilities of structuring code in ways that facilitate this denotational paradigm. In the notorious lazy debate assessment by Bob Harper and the Haskell community, Professor Harper demonstrates the problems that lazy assessments pose for practical programs - and among Lennart Augssson - protection against laziness, this best illustrates the point:
"I have kept my biggest problem of strict evaluation in recent times. A strict evaluation is fundamentally wrong for reusing a function. [...] With a strict evaluation, you can no longer tell people with a straight face: do not use recursion, reusing recursion patterns on a map, filter, foldr, etc. It just doesn’t work (in general). [...] a strict assessment really, fundamentally stops you from reusing functions as you can with laziness. "
And for an example of reusing a function using a lazy evaluation, Augustson suggests: "It is natural to express the function any by reusing the map and or functions." Such a lazy appraisal arises from this picture as a rather expensive linguistic function, encompassed in serving a more natural coding style.
What else do we need to maintain an abstract, denotational coding style? A powerful optimizing compiler can come in handy! Thus, even if there is no technical or necessary connection between static types and lazy evaluation, the two functions are oriented towards the same goal. Not surprisingly, they often appear together.
sacheie
source share