on master help sign in
Drop trailing whitespace
commit716ce6bfd0def52b69af40bb3e0b25cd77e1c5d6 authorBryan O'Sullivan <bos@serpentine.com> dateFri 29 Jun 2012, 09:09 (14 years ago) parent26c0482
20 files changed+40−40
Data/Text.hs+4−4 Data/Text/Encoding/Error.hs+1−1 Data/Text/Encoding/Utf8.hs+1−1 Data/Text/Fusion/Common.hs+1−1 Data/Text/IO.hs+5−5 Data/Text/IO/Internal.hs+2−2 Data/Text/Lazy.hs+3−3 Data/Text/Lazy/Builder.hs+4−4 Data/Text/Lazy/Encoding/Fusion.hs+1−1 Data/Text/Lazy/IO.hs+2−2 Data/Text/Lazy/Internal.hs+1−1 Data/Text/Search.hs+1−1 Data/Text/Unsafe.hs+1−1 Data/Text/Unsafe/Base.hs+1−1 benchmarks/haskell/Benchmarks/Programs/StripTags.hs+1−1 benchmarks/haskell/Benchmarks/ReadNumbers.hs+1−1 cbits/cbits.c+1−1 scripts/Arsec.hs+1−1 tests/Tests/QuickCheckUtils.hs+6−6 text.cabal+2−2
Data/Text.hs+4−4
@@ -167,7 +167,7 @@ module Data.Text
167167 , partition
168168
169169 -- , findSubstring
170−
170+
171171 -- * Indexing
172172 -- $index
173173 , index
@@ -330,7 +330,7 @@ instance NFData Text
330330
331331-- This instance preserves data abstraction at the cost of inefficiency.
332332-- We omit reflection services for the sake of data abstraction.
333−--
333+--
334334-- This instance was created by copying the behavior of Data.Set and
335335-- Data.Map. If you feel a mistake has been made, please feel free to
336336-- submit improvements.
@@ -1129,7 +1129,7 @@ findAIndexOrEnd q t@(Text _arr _off len) = go 0
11291129 where go !i | i >= len || q c = i
11301130 | otherwise = go (i+d)
11311131 where Iter c d = iter t i
1132−
1132+
11331133-- | /O(n)/ Group characters in a string by equality.
11341134group :: Text -> [Text]
11351135group = groupBy (==)
@@ -1162,7 +1162,7 @@ tails t | null t = [empty]
11621162-- > splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"]
11631163-- > splitOn "aaa" "aaaXaaaXaaaXaaa" == ["","X","X","X",""]
11641164-- > splitOn "x" "x" == ["",""]
1165−--
1165+--
11661166-- and
11671167--
11681168-- > intercalate s . splitOn s == id
Data/Text/Encoding/Error.hs+1−1
@@ -88,7 +88,7 @@ showUnicodeException (EncodeError desc (Just c))
8888 = "Cannot encode character '\\x" ++ showHex (fromEnum c) ("': " ++ desc)
8989showUnicodeException (EncodeError desc Nothing)
9090 = "Cannot encode input: " ++ desc
91−
91+
9292instance Show UnicodeException where
9393 show = showUnicodeException
9494
Data/Text/Encoding/Utf8.hs+1−1
@@ -146,7 +146,7 @@ validate3 x1 x2 x3 = validate3_1 || validate3_2 || validate3_3 || validate3_4
146146validate4 :: Word8 -> Word8 -> Word8 -> Word8 -> Bool
147147{-# INLINE validate4 #-}
148148validate4 x1 x2 x3 x4 = validate4_1 || validate4_2 || validate4_3
149− where
149+ where
150150 validate4_1 = x1 == 0xF0 &&
151151 between x2 0x90 0xBF &&
152152 between x3 0x80 0xBF &&
Data/Text/Fusion/Common.hs+1−1
@@ -307,7 +307,7 @@ lengthI (Stream next s0 _len) = loop_length 0 s0
307307-- of 'lengthI', but can short circuit if the count of characters is
308308-- greater than the number, and hence be more efficient.
309309compareLengthI :: Integral a => Stream Char -> a -> Ordering
310−compareLengthI (Stream next s0 len) n =
310+compareLengthI (Stream next s0 len) n =
311311 case exactly len of
312312 Nothing -> loop_cmp 0 s0
313313 Just i -> compare (fromIntegral i) n
Data/Text/IO.hs+5−5
@@ -16,7 +16,7 @@
1616module Data.Text.IO
1717 (
1818 -- * Performance
19− -- $performance
19+ -- $performance
2020
2121 -- * Locale support
2222 -- $locale
@@ -133,7 +133,7 @@ hGetContents h = do
133133 ts <- readChunks
134134 (hh', _) <- hClose_help hh
135135 return (hh'{haType=ClosedHandle}, T.concat ts)
136−
136+
137137-- | Use a more efficient buffer size if we're reading in
138138-- block-buffered mode with the default buffer size. When we can
139139-- determine the size of the handle we're reading, set the buffer size
@@ -167,7 +167,7 @@ hPutStr h = B.hPutStr h . encodeUtf8
167167#else
168168-- This function is lifted almost verbatim from GHC.IO.Handle.Text.
169169hPutStr h t = do
170− (buffer_mode, nl) <-
170+ (buffer_mode, nl) <-
171171 wantWritableHandle "hPutStr" h $ \h_ -> do
172172 bmode <- getSpareBuffer h_
173173 return (bmode, haOutputNL h_)
@@ -249,7 +249,7 @@ writeBlocksRaw h buf0 (Stream next0 s0 _len) = outer s0 buf0
249249
250250-- This function is completely lifted from GHC.IO.Handle.Text.
251251getSpareBuffer :: Handle__ -> IO (BufferMode, CharBuffer)
252−getSpareBuffer Handle__{haCharBuffer=ref,
252+getSpareBuffer Handle__{haCharBuffer=ref,
253253 haBuffers=spare_ref,
254254 haBufferMode=mode}
255255 = do
@@ -270,7 +270,7 @@ getSpareBuffer Handle__{haCharBuffer=ref,
270270-- This function is completely lifted from GHC.IO.Handle.Text.
271271commitBuffer :: Handle -> RawCharBuffer -> Int -> Int -> Bool -> Bool
272272 -> IO CharBuffer
273−commitBuffer hdl !raw !sz !count flush release =
273+commitBuffer hdl !raw !sz !count flush release =
274274 wantWritableHandle "commitAndReleaseBuffer" hdl $
275275 commitBuffer' raw sz count flush release
276276{-# INLINE commitBuffer #-}
Data/Text/IO/Internal.hs+2−2
@@ -85,8 +85,8 @@ hGetLineLoop hh@Handle__{..} = go where
8585maybeFillReadBuffer :: Handle__ -> CharBuffer -> IO (Maybe CharBuffer)
8686maybeFillReadBuffer handle_ buf
8787 = catch (Just `fmap` getSomeCharacters handle_ buf) $ \e ->
88− if isEOFError e
89− then return Nothing
88+ if isEOFError e
89+ then return Nothing
9090 else ioError e
9191
9292unpack :: RawCharBuffer -> Int -> Int -> IO Text
Data/Text/Lazy.hs+3−3
@@ -174,7 +174,7 @@ module Data.Text.Lazy
174174 , partition
175175
176176 -- , findSubstring
177−
177+
178178 -- * Indexing
179179 , index
180180 , count
@@ -921,7 +921,7 @@ drop i t0
921921 | otherwise = drop' i t0
922922 where drop' 0 ts = ts
923923 drop' _ Empty = Empty
924− drop' n (Chunk t ts)
924+ drop' n (Chunk t ts)
925925 | n < len = Chunk (T.drop (fromIntegral n) t) ts
926926 | otherwise = drop' (n - len) ts
927927 where len = fromIntegral (T.length t)
@@ -1209,7 +1209,7 @@ tails ts@(Chunk t ts')
12091209-- > splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"]
12101210-- > splitOn "aaa" "aaaXaaaXaaaXaaa" == ["","X","X","X",""]
12111211-- > splitOn "x" "x" == ["",""]
1212−--
1212+--
12131213-- and
12141214--
12151215-- > intercalate s . splitOn s == id
Data/Text/Lazy/Builder.hs+4−4
@@ -5,7 +5,7 @@
55-- Module : Data.Text.Lazy.Builder
66-- Copyright : (c) 2010 Johan Tibell
77-- License : BSD3-style (see LICENSE)
8−--
8+--
99-- Maintainer : Johan Tibell <johan.tibell@gmail.com>
1010-- Stability : experimental
1111-- Portability : portable to Hugs and GHC
@@ -139,7 +139,7 @@ append (Builder f) (Builder g) = Builder (f . g)
139139
140140-- TODO: Experiment to find the right threshold.
141141copyLimit :: Int
142−copyLimit = 128
142+copyLimit = 128
143143
144144-- This function attempts to merge small @Text@ values instead of
145145-- treating each value as its own chunk. We may not always want this.
@@ -292,14 +292,14 @@ append' (Builder f) (Builder g) = Builder (f . g)
292292"append/writeAtMost" forall a b (f::forall s. A.MArray s -> Int -> ST s Int)
293293 (g::forall s. A.MArray s -> Int -> ST s Int) ws.
294294 append (writeAtMost a f) (append (writeAtMost b g) ws) =
295− append (writeAtMost (a+b) (\marr o -> f marr o >>= \ n ->
295+ append (writeAtMost (a+b) (\marr o -> f marr o >>= \ n ->
296296 g marr (o+n) >>= \ m ->
297297 let s = n+m in s `seq` return s)) ws
298298
299299"writeAtMost/writeAtMost" forall a b (f::forall s. A.MArray s -> Int -> ST s Int)
300300 (g::forall s. A.MArray s -> Int -> ST s Int).
301301 append (writeAtMost a f) (writeAtMost b g) =
302− writeAtMost (a+b) (\marr o -> f marr o >>= \ n ->
302+ writeAtMost (a+b) (\marr o -> f marr o >>= \ n ->
303303 g marr (o+n) >>= \ m ->
304304 let s = n+m in s `seq` return s)
305305
Data/Text/Lazy/Encoding/Fusion.hs+1−1
@@ -5,7 +5,7 @@
55-- Copyright : (c) 2009, 2010 Bryan O'Sullivan
66--
77-- License : BSD-style
8−-- Maintainer : bos@serpentine.com, rtomharper@googlemail.com,
8+-- Maintainer : bos@serpentine.com, rtomharper@googlemail.com,
99-- duncan@haskell.org
1010-- Stability : experimental
1111-- Portability : portable
Data/Text/Lazy/IO.hs+2−2
@@ -16,7 +16,7 @@
1616module Data.Text.Lazy.IO
1717 (
1818 -- * Performance
19− -- $performance
19+ -- $performance
2020
2121 -- * Locale support
2222 -- $locale
@@ -119,7 +119,7 @@ lazyRead h = unsafeInterleaveIO $
119119 case haType hh of
120120 ClosedHandle -> return (hh, L.empty)
121121 SemiClosedHandle -> lazyReadBuffered h hh
122− _ -> ioException
122+ _ -> ioException
123123 (IOError (Just h) IllegalOperation "hGetContents"
124124 "illegal handle type" Nothing Nothing)
125125
Data/Text/Lazy/Internal.hs+1−1
@@ -8,7 +8,7 @@
88-- duncan@haskell.org
99-- Stability : experimental
1010-- Portability : GHC
11−--
11+--
1212-- A module containing private 'Text' internals. This exposes the
1313-- 'Text' representation and low level construction functions.
1414-- Modules which extend the 'Text' system may need to use this module.
Data/Text/Search.hs+1−1
@@ -14,7 +14,7 @@
1414-- Horspool, Sunday, and Lundh.
1515--
1616-- References:
17−--
17+--
1818-- * R. S. Boyer, J. S. Moore: A Fast String Searching Algorithm.
1919-- Communications of the ACM, 20, 10, 762-772 (1977)
2020--
Data/Text/Unsafe.hs+1−1
@@ -24,7 +24,7 @@ module Data.Text.Unsafe
2424 , takeWord16
2525 , dropWord16
2626 ) where
27−
27+
2828#if defined(ASSERTS)
2929import Control.Exception (assert)
3030#endif
Data/Text/Unsafe/Base.hs+1−1
@@ -15,7 +15,7 @@ module Data.Text.Unsafe.Base
1515 inlineInterleaveST
1616 , inlinePerformIO
1717 ) where
18−
18+
1919import GHC.ST (ST(..))
2020#if defined(__GLASGOW_HASKELL__)
2121# if __GLASGOW_HASKELL__ >= 611
benchmarks/haskell/Benchmarks/Programs/StripTags.hs+1−1
@@ -14,7 +14,7 @@
1414module Benchmarks.Programs.StripTags
1515 ( benchmark
1616 ) where
17−
17+
1818import Criterion (Benchmark, bgroup, bench)
1919import Data.List (mapAccumL)
2020import System.IO (Handle, hPutStr)
benchmarks/haskell/Benchmarks/ReadNumbers.hs+1−1
@@ -88,7 +88,7 @@ text reader = foldl' go 1000000
8888 where
8989 go z t = case reader t of Left _ -> z
9090 Right (n, _) -> min n z
91−
91+
9292byteString :: (Ord a, Num a) => (t -> Maybe (a,t)) -> [t] -> a
9393byteString reader = foldl' go 1000000
9494 where
cbits/cbits.c+1−1
@@ -47,7 +47,7 @@ static const uint8_t utf8d[] = {
4747 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
4848 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
4949 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
50− 12,36,12,12,12,12,12,12,12,12,12,12,
50+ 12,36,12,12,12,12,12,12,12,12,12,12,
5151};
5252
5353static inline uint32_t
scripts/Arsec.hs+1−1
@@ -26,7 +26,7 @@ import Text.ParserCombinators.Parsec.Prim hiding ((<|>), many)
2626instance Applicative (GenParser s a) where
2727 pure = return
2828 (<*>) = ap
29−
29+
3030instance Alternative (GenParser s a) where
3131 empty = mzero
3232 (<|>) = mplus
tests/Tests/QuickCheckUtils.hs+6−6
@@ -24,7 +24,7 @@ module Tests.QuickCheckUtils
2424 , eqP
2525
2626 , Encoding (..)
27−
27+
2828 , write_read
2929 ) where
3030
@@ -67,7 +67,7 @@ genUnicode = fmap fromString string where
6767 string = sized $ \n ->
6868 do k <- choose (0,n)
6969 sequence [ char | _ <- [1..k] ]
70−
70+
7171 excluding :: [a -> Bool] -> Gen a -> Gen a
7272 excluding bad gen = loop
7373 where
@@ -76,14 +76,14 @@ genUnicode = fmap fromString string where
7676 if or (map ($ x) bad)
7777 then loop
7878 else return x
79−
79+
8080 reserved = [lowSurrogate, highSurrogate, noncharacter]
8181 lowSurrogate c = c >= 0xDC00 && c <= 0xDFFF
8282 highSurrogate c = c >= 0xD800 && c <= 0xDBFF
8383 noncharacter c = masked == 0xFFFE || masked == 0xFFFF
8484 where
85− masked = c .&. 0xFFFF
86−
85+ masked = c .&. 0xFFFF
86+
8787 ascii = choose (0,0x7F)
8888 plane0 = choose (0xF0, 0xFFFF)
8989 plane1 = oneof [ choose (0x10000, 0x10FFF)
@@ -109,7 +109,7 @@ genUnicode = fmap fromString string where
109109 ]
110110 plane14 = choose (0xE0000, 0xE0FFF)
111111 planes = [ascii, plane0, plane1, plane2, plane14]
112−
112+
113113 char = chr `fmap` excluding reserved (oneof planes)
114114
115115-- For tests that have O(n^2) running times or input sizes, resize
text.cabal+2−2
@@ -3,7 +3,7 @@ version: 0.11.2.2
33homepage: https://github.com/bos/text
44bug-reports: https://github.com/bos/text/issues
55synopsis: An efficient packed Unicode text type.
6−description:
6+description:
77 .
88 An efficient packed, immutable Unicode text type (both strict and
99 lazy), with a powerful loop fusion optimization framework.
@@ -148,7 +148,7 @@ library
148148 else
149149 cpp-options: -DINTEGER_GMP
150150 build-depends: integer-gmp >= 0.2 && < 0.5
151−
151+
152152
153153 if impl(ghc >= 6.9) && impl(ghc < 6.11)
154154 cpp-options: -DINTEGER_GMP