[Haskell-cafe] Alternative name for return

Bardur Arantsson spam at scientician.net
Wed Aug 7 23:27:36 CEST 2013


On 2013-08-07 22:38, Joe Quinn wrote:
> 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!
> 

Your point being? x is the same thing regardless of how many times you
run it.







More information about the Haskell-Cafe mailing list