[PRL] the "success" of types
Paul A. Steckler
steck at stecksoft.com
Fri May 19 14:14:47 EDT 2006
> Just in case it isn't clear: I am not arguing against stating
> invariants in imperative programming. I am only arguing against buying
> the "types did it all, and nobody else was around" story and dumping
> the functional programming idea.
Here's the Haskell equivalent of Scheme's for-each:
mapM_ :: Monad m => (a -> m b) -> [a] -> m ()
It's in fact more general than for-each, because
it's parametric in the monad.
As a programmer, the type of this combinator
gives me understanding beyond the understanding
I have from reading the textual description of
for-each. Or at least, the type conveys that
understanding much more concisely.
I'd say that types have definite added value, even
where there's a functional core.
By the way, did you notice how Algol60 declined
precipitously after the Kennedy assassination?
-- Paul
More information about the PRL
mailing list