[Haskell-cafe] Re: pure programs

Achim Schneider barsoap at web.de
Wed Nov 5 04:15:48 EST 2008


"Jason Dusek" <jason.dusek at gmail.com> wrote:

> Can these components can
>   be Haskell functions without IO in their signatures?
>
Sure. You might, for example, abstract networking out of your web
server and thus end up with a function of type

serve :: [HTTPRequest] -> [HTTPResponse]

that lazily maps its input stream to an output stream. You can keep
state by passing your state to yourself in a recursive call or do
something more involved like using the state monad, but you'll find it
very, very, very hard to write a genuinely non-deterministic program
without changing input data, no matter what you do, even on
multiprocessors.

Enabling such things seems rather to be the scope of INTERCAL... does
it already have a MAYBE COME FROM statement that relies on an external
random source?

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.




More information about the Haskell-Cafe mailing list