
1 Feb
2008
1 Feb
'08
5:34 a.m.
Hello Roman, Friday, February 1, 2008, 11:03:36 AM, you wrote:
the right way to deal with "modifiers" is to attach them to the Handle itself like this:
f <- openFile "name" >>= withLocking >>= withEncoding utf8
IMO, global state is never "the right way" if it can be avoided. It will always lead to problems. Especially in a functional language like Haskell.
so you propose something like this: s <- readString "/path/filename" TextMode "utf8" line_num ? :) please read http://haskell.org/haskellwiki/Library/Streams - it's not what you have imagined reading this example -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com