Bryan O'Sullivan avatar Bryan O'Sullivan committed 4d31ea8

Drop trailing whitespace

Comments (0)

Files changed (20)

     , partition
 
     -- , findSubstring
-    
+
     -- * Indexing
     -- $index
     , index
 
 -- This instance preserves data abstraction at the cost of inefficiency.
 -- We omit reflection services for the sake of data abstraction.
--- 
+--
 -- This instance was created by copying the behavior of Data.Set and
 -- Data.Map. If you feel a mistake has been made, please feel free to
 -- submit improvements.
     where go !i | i >= len || q c       = i
                 | otherwise             = go (i+d)
                 where Iter c d          = iter t i
-    
+
 -- | /O(n)/ Group characters in a string by equality.
 group :: Text -> [Text]
 group = groupBy (==)
 -- > splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"]
 -- > splitOn "aaa"  "aaaXaaaXaaaXaaa"  == ["","X","X","X",""]
 -- > splitOn "x"    "x"                == ["",""]
--- 
+--
 -- and
 --
 -- > intercalate s . splitOn s         == id

Data/Text/Encoding/Error.hs

     = "Cannot encode character '\\x" ++ showHex (fromEnum c) ("': " ++ desc)
 showUnicodeException (EncodeError desc Nothing)
     = "Cannot encode input: " ++ desc
-                     
+
 instance Show UnicodeException where
     show = showUnicodeException
 

Data/Text/Encoding/Utf8.hs

 validate4 :: Word8 -> Word8 -> Word8 -> Word8 -> Bool
 {-# INLINE validate4 #-}
 validate4 x1 x2 x3 x4 = validate4_1 || validate4_2 || validate4_3
-  where 
+  where
     validate4_1 = x1 == 0xF0 &&
                   between x2 0x90 0xBF &&
                   between x3 0x80 0xBF &&

Data/Text/Fusion/Common.hs

 -- of 'lengthI', but can short circuit if the count of characters is
 -- greater than the number, and hence be more efficient.
 compareLengthI :: Integral a => Stream Char -> a -> Ordering
-compareLengthI (Stream next s0 len) n = 
+compareLengthI (Stream next s0 len) n =
     case exactly len of
       Nothing -> loop_cmp 0 s0
       Just i  -> compare (fromIntegral i) n
 module Data.Text.IO
     (
     -- * Performance
-    -- $performance 
+    -- $performance
 
     -- * Locale support
     -- $locale
     ts <- readChunks
     (hh', _) <- hClose_help hh
     return (hh'{haType=ClosedHandle}, T.concat ts)
-  
+
 -- | Use a more efficient buffer size if we're reading in
 -- block-buffered mode with the default buffer size.  When we can
 -- determine the size of the handle we're reading, set the buffer size
 #else
 -- This function is lifted almost verbatim from GHC.IO.Handle.Text.
 hPutStr h t = do
-  (buffer_mode, nl) <- 
+  (buffer_mode, nl) <-
        wantWritableHandle "hPutStr" h $ \h_ -> do
                      bmode <- getSpareBuffer h_
                      return (bmode, haOutputNL h_)
 
 -- This function is completely lifted from GHC.IO.Handle.Text.
 getSpareBuffer :: Handle__ -> IO (BufferMode, CharBuffer)
-getSpareBuffer Handle__{haCharBuffer=ref, 
+getSpareBuffer Handle__{haCharBuffer=ref,
                         haBuffers=spare_ref,
                         haBufferMode=mode}
  = do
 -- This function is completely lifted from GHC.IO.Handle.Text.
 commitBuffer :: Handle -> RawCharBuffer -> Int -> Int -> Bool -> Bool
              -> IO CharBuffer
-commitBuffer hdl !raw !sz !count flush release = 
+commitBuffer hdl !raw !sz !count flush release =
   wantWritableHandle "commitAndReleaseBuffer" hdl $
      commitBuffer' raw sz count flush release
 {-# INLINE commitBuffer #-}

Data/Text/IO/Internal.hs

 maybeFillReadBuffer :: Handle__ -> CharBuffer -> IO (Maybe CharBuffer)
 maybeFillReadBuffer handle_ buf
   = catch (Just `fmap` getSomeCharacters handle_ buf) $ \e ->
-      if isEOFError e 
-      then return Nothing 
+      if isEOFError e
+      then return Nothing
       else ioError e
 
 unpack :: RawCharBuffer -> Int -> Int -> IO Text

Data/Text/Lazy.hs

     , partition
 
     -- , findSubstring
-    
+
     -- * Indexing
     , index
     , count
     | otherwise = drop' i t0
   where drop' 0 ts           = ts
         drop' _ Empty        = Empty
-        drop' n (Chunk t ts) 
+        drop' n (Chunk t ts)
             | n < len   = Chunk (T.drop (fromIntegral n) t) ts
             | otherwise = drop' (n - len) ts
             where len   = fromIntegral (T.length t)
 -- > splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"]
 -- > splitOn "aaa"  "aaaXaaaXaaaXaaa"  == ["","X","X","X",""]
 -- > splitOn "x"    "x"                == ["",""]
--- 
+--
 -- and
 --
 -- > intercalate s . splitOn s         == id

Data/Text/Lazy/Builder.hs

 -- Module      : Data.Text.Lazy.Builder
 -- Copyright   : (c) 2010 Johan Tibell
 -- License     : BSD3-style (see LICENSE)
--- 
+--
 -- Maintainer  : Johan Tibell <johan.tibell@gmail.com>
 -- Stability   : experimental
 -- Portability : portable to Hugs and GHC
 
 -- TODO: Experiment to find the right threshold.
 copyLimit :: Int
-copyLimit = 128                                 
+copyLimit = 128
 
 -- This function attempts to merge small @Text@ values instead of
 -- treating each value as its own chunk.  We may not always want this.
 "append/writeAtMost" forall a b (f::forall s. A.MArray s -> Int -> ST s Int)
                            (g::forall s. A.MArray s -> Int -> ST s Int) ws.
     append (writeAtMost a f) (append (writeAtMost b g) ws) =
-        append (writeAtMost (a+b) (\marr o -> f marr o >>= \ n -> 
+        append (writeAtMost (a+b) (\marr o -> f marr o >>= \ n ->
                                     g marr (o+n) >>= \ m ->
                                     let s = n+m in s `seq` return s)) ws
 
 "writeAtMost/writeAtMost" forall a b (f::forall s. A.MArray s -> Int -> ST s Int)
                            (g::forall s. A.MArray s -> Int -> ST s Int).
     append (writeAtMost a f) (writeAtMost b g) =
-        writeAtMost (a+b) (\marr o -> f marr o >>= \ n -> 
+        writeAtMost (a+b) (\marr o -> f marr o >>= \ n ->
                             g marr (o+n) >>= \ m ->
                             let s = n+m in s `seq` return s)
 

Data/Text/Lazy/Encoding/Fusion.hs

 -- Copyright   : (c) 2009, 2010 Bryan O'Sullivan
 --
 -- License     : BSD-style
--- Maintainer  : bos@serpentine.com, rtomharper@googlemail.com, 
+-- Maintainer  : bos@serpentine.com, rtomharper@googlemail.com,
 --               duncan@haskell.org
 -- Stability   : experimental
 -- Portability : portable

Data/Text/Lazy/IO.hs

 module Data.Text.Lazy.IO
     (
     -- * Performance
-    -- $performance 
+    -- $performance
 
     -- * Locale support
     -- $locale
     case haType hh of
       ClosedHandle     -> return (hh, L.empty)
       SemiClosedHandle -> lazyReadBuffered h hh
-      _                -> ioException 
+      _                -> ioException
                           (IOError (Just h) IllegalOperation "hGetContents"
                            "illegal handle type" Nothing Nothing)
 

Data/Text/Lazy/Internal.hs

 --               duncan@haskell.org
 -- Stability   : experimental
 -- Portability : GHC
--- 
+--
 -- A module containing private 'Text' internals. This exposes the
 -- 'Text' representation and low level construction functions.
 -- Modules which extend the 'Text' system may need to use this module.

Data/Text/Search.hs

 -- Horspool, Sunday, and Lundh.
 --
 -- References:
--- 
+--
 -- * R. S. Boyer, J. S. Moore: A Fast String Searching Algorithm.
 --   Communications of the ACM, 20, 10, 762-772 (1977)
 --

Data/Text/Unsafe.hs

     , takeWord16
     , dropWord16
     ) where
-     
+
 #if defined(ASSERTS)
 import Control.Exception (assert)
 #endif

Data/Text/Unsafe/Base.hs

       inlineInterleaveST
     , inlinePerformIO
     ) where
-     
+
 import GHC.ST (ST(..))
 #if defined(__GLASGOW_HASKELL__)
 # if __GLASGOW_HASKELL__ >= 611

benchmarks/haskell/Benchmarks/Programs/StripTags.hs

 module Benchmarks.Programs.StripTags
     ( benchmark
     ) where
-     
+
 import Criterion (Benchmark, bgroup, bench)
 import Data.List (mapAccumL)
 import System.IO (Handle, hPutStr)

benchmarks/haskell/Benchmarks/ReadNumbers.hs

   where
     go z t = case reader t of Left _       -> z
                               Right (n, _) -> min n z
-    
+
 byteString :: (Ord a, Num a) => (t -> Maybe (a,t)) -> [t] -> a
 byteString reader = foldl' go 1000000
   where
   12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
   12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
   12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
-  12,36,12,12,12,12,12,12,12,12,12,12, 
+  12,36,12,12,12,12,12,12,12,12,12,12,
 };
 
 static inline uint32_t
 instance Applicative (GenParser s a) where
     pure = return
     (<*>) = ap
-    
+
 instance Alternative (GenParser s a) where
     empty = mzero
     (<|>) = mplus

tests/Tests/QuickCheckUtils.hs

     , eqP
 
     , Encoding (..)
-    
+
     , write_read
     ) where
 
     string = sized $ \n ->
         do k <- choose (0,n)
            sequence [ char | _ <- [1..k] ]
-    
+
     excluding :: [a -> Bool] -> Gen a -> Gen a
     excluding bad gen = loop
       where
           if or (map ($ x) bad)
             then loop
             else return x
-    
+
     reserved = [lowSurrogate, highSurrogate, noncharacter]
     lowSurrogate c = c >= 0xDC00 && c <= 0xDFFF
     highSurrogate c = c >= 0xD800 && c <= 0xDBFF
     noncharacter c = masked == 0xFFFE || masked == 0xFFFF
       where
-        masked = c .&. 0xFFFF 
-    
+        masked = c .&. 0xFFFF
+
     ascii = choose (0,0x7F)
     plane0 = choose (0xF0, 0xFFFF)
     plane1 = oneof [ choose (0x10000, 0x10FFF)
                    ]
     plane14 = choose (0xE0000, 0xE0FFF)
     planes = [ascii, plane0, plane1, plane2, plane14]
-    
+
     char = chr `fmap` excluding reserved (oneof planes)
 
 -- For tests that have O(n^2) running times or input sizes, resize
 homepage:       https://github.com/bos/text
 bug-reports:    https://github.com/bos/text/issues
 synopsis:       An efficient packed Unicode text type.
-description:    
+description:
     .
     An efficient packed, immutable Unicode text type (both strict and
     lazy), with a powerful loop fusion optimization framework.
     else
       cpp-options: -DINTEGER_GMP
       build-depends: integer-gmp >= 0.2 && < 0.5
-   
+
 
   if impl(ghc >= 6.9) && impl(ghc < 6.11)
     cpp-options: -DINTEGER_GMP
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.