[Haskell-cafe] Alternative name for return

Richard A. O'Keefe ok at cs.otago.ac.nz
Wed Aug 7 03:10:11 CEST 2013


On 6/08/2013, at 9:28 PM, J. Stutterheim wrote:

> That argument makes sense, although I find it a bit counter-intuitive still.

In discussions like this, I have never been able to discover any meaning for
"intuitive" other than "familiar".  Applying "pure" to an IO operation doesn't
go against *my* intuition because Haskell has *trained* my intuition to
see 'putStrLn "Hi"' as a pure value; it's not the thing itself that has effects,
but its interpretation by an outer engine, just as my magnetic card key has by
itself no power to open doors, but the magnetic reader that looks at the card
_does_.  I don't attribute agency to the card!  I'm not arguing that my
intuition is _right_, only that it is _different_.

In particular, for anyone who has much experience with Haskell, "return" is
almost the only name that could possibly be intuitive because that _is_ the
name that is familiar.  Haskell programmers who've got used to Applicative
will also find "pure" intuitive, *because it is familiar*.

I bet you can find an abundance of C programmers who think that
"strcmp" is an intuitive name for string comparison (rather than compression, say).






More information about the Haskell-Cafe mailing list