@@ -1,14 +1,14 @@
1{-# LANGUAGE BangPatterns, CPP #-}
1{-# LANGUAGE BangPatterns, CPP #-}
3-- Module : Data.Text.IO
3-- Module : Data.Text.IO
4−-- Copyright : (c) Bryan O'Sullivan 2009
4+-- Copyright : (c) Bryan O'Sullivan 2009,
5+-- (c) Simon Marlow 2009
5-- License : BSD-style
6-- License : BSD-style
6-- Maintainer : bos@serpentine.com
7-- Maintainer : bos@serpentine.com
7-- Stability : experimental
8-- Stability : experimental
8-- Portability : GHC
9-- Portability : GHC
10-- Support for text I\/O.
11-- Support for text I\/O.
13module Data.Text.IO
13module Data.Text.IO
@@ -170,11 +170,7 @@ hPutStrLn h t = hPutStr h t >> hPutChar h '\n'
170-- passed to this function as its argument, and the resulting string
170-- passed to this function as its argument, and the resulting string
171-- is output on the standard output device.
171-- is output on the standard output device.
172interact :: (Text -> Text) -> IO ()
172interact :: (Text -> Text) -> IO ()
173−#if __GLASGOW_HASKELL__ <= 610
173+interact f = putStr . f =<< getContents
174−interact f = B.interact (encodeUtf8 . f . decodeUtf8)
176−interact f = undefined
179-- | Read all user input on 'stdin' as a single string.
175-- | Read all user input on 'stdin' as a single string.
180getContents :: IO Text
176getContents :: IO Text