[Haskell-beginners] Re: testing and the culture of Haskell

Heinrich Apfelmus apfelmus at quantentunnel.de
Fri Jan 22 05:37:12 EST 2010


David Virebayre wrote:
> Stephen Blackheath wrote:
>>
>> All Haskell functions are pure without exception.  For example:
> 
> 
> Back to IO. What exactly would be the representation of an IO action,
> if not an abstract notion ? Hopefully that is optimised out by the
> compiler. Indeed, If I look at the compiled output of a simple
> program, it looks to me like the effects are executed within the
> function, and no special structure is returned.

Sure, it's an abstraction, which means that the compiler is free to
optimize it ruthlessly.

But you are also free to implement it differently, like for the purpose
of testing:

  Swierstra und Altenkirch. Beauty in the beast.
  http://www.cse.chalmers.se/~wouter/Publications/BeautyInTheBeast.pdf


Regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com



More information about the Beginners mailing list