
21 Sep
2006
21 Sep
'06
12:55 a.m.
dons:
br1:
Second, I want to test this function, without hitting the filesystem. In C++ I would use a istringstream. I couldn't find a function that returns a Handle from a String. The closer thing that may work that I could find was making a pipe and convertind the file descriptor. Can I simplify that function to take it out of the IO monad? How? I thought about getContents, but that eats all input.
Oh, another thing to check would be that the correct characters are returned, such as: *A> quickCheck (\s -> all (`elem` ['a'..'e']) (take5 s)) OK, passed 100 tests. So for all strings QuickCheck produced, all Chars in the string returned by take5 where elements of ['a'..'e']. -- Don