[Haskell-cafe] Alternative name for return
Joe Quinn
headprogrammingczar at gmail.com
Wed Aug 7 22:38:23 CEST 2013
On 8/7/2013 11:00 AM, David Thomas wrote:
> twice :: IO () -> IO ()
> twice x = x >> x
>
> I would call that evaluating x twice (incidentally creating two
> separate evaluations of one pure action description), but I'd like to
> better see your perspective here.
x is only evaluated once, but /executed/ twice. For IO, that means
magic. For other types, it means different things. For Identity, twice = id!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130807/57a008d3/attachment.htm>
More information about the Haskell-Cafe
mailing list