[Haskell-cafe] IO Monad

yin yin at atom.sk
Tue Jul 19 18:21:08 EDT 2005

Dinh Tien Tuan Anh wrote:

> Hi,
> Could anyone explain for me why its not possible to return a primitive
> type (such as Integer, String) while doing some IO actions ?
> e.g: foo :: IO() -> String
> What does it have to do with "lazy evalution" paradigm ?
In short, to not break functional aproach. Non-IO functions can't call
IO functions, because IO functions are evaluated every time you call them.

Matej 'Yin' Gagyi

More information about the Haskell-Cafe mailing list