haskell Prevent or capture writing to stdout and other handles.