on master help sign in
Simplify interact.

--HG-- extra : convert_revision : fcf9d06f76d73eebbf39e71ac0034eda188486bb

commit033b9d4f0611c3366c560386994297afaa1d87da authorBryan O'Sullivan <bos@serpentine.com> dateMon 14 Dec 2009, 20:46 (17 years ago) parente2ad6ab
1 file changed+3−7
Data/Text/IO.hs+3−7
Data/Text/IO.hs+3−7
@@ -1,14 +1,14 @@
11{-# LANGUAGE BangPatterns, CPP #-}
22-- |
33-- Module : Data.Text.IO
4−-- Copyright : (c) Bryan O'Sullivan 2009
4+-- Copyright : (c) Bryan O'Sullivan 2009,
5+-- (c) Simon Marlow 2009
56-- License : BSD-style
67-- Maintainer : bos@serpentine.com
78-- Stability : experimental
89-- Portability : GHC
910--
1011-- Support for text I\/O.
11−--
1212
1313module Data.Text.IO
1414 (
@@ -170,11 +170,7 @@ hPutStrLn h t = hPutStr h t >> hPutChar h '\n'
170170-- passed to this function as its argument, and the resulting string
171171-- is output on the standard output device.
172172interact :: (Text -> Text) -> IO ()
173−#if __GLASGOW_HASKELL__ <= 610
174−interact f = B.interact (encodeUtf8 . f . decodeUtf8)
175−#else
176−interact f = undefined
177−#endif
173+interact f = putStr . f =<< getContents
178174
179175-- | Read all user input on 'stdin' as a single string.
180176getContents :: IO Text