diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-24 23:42:55 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-24 23:42:55 +0200 |
commit | 805ee118b823f271dfd8036d35b15eb3454a95ad (patch) | |
tree | 23a46454f15fe76789ed80b88f1a7cf723107047 /libraries/base/Text | |
parent | 4b648be19c75e6c6a8e6f9f93fa12c7a4176f0ae (diff) | |
download | haskell-805ee118b823f271dfd8036d35b15eb3454a95ad.tar.gz |
`M-x delete-trailing-whitespace` & `M-x untabify`
...several modules in `base` recently touched by me
Diffstat (limited to 'libraries/base/Text')
-rw-r--r-- | libraries/base/Text/ParserCombinators/ReadP.hs | 28 | ||||
-rw-r--r-- | libraries/base/Text/ParserCombinators/ReadPrec.hs | 4 | ||||
-rw-r--r-- | libraries/base/Text/Read.hs | 4 | ||||
-rw-r--r-- | libraries/base/Text/Read/Lex.hs | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/libraries/base/Text/ParserCombinators/ReadP.hs b/libraries/base/Text/ParserCombinators/ReadP.hs index 48cbe57e5d..4de0908b23 100644 --- a/libraries/base/Text/ParserCombinators/ReadP.hs +++ b/libraries/base/Text/ParserCombinators/ReadP.hs @@ -9,13 +9,13 @@ -- Module : Text.ParserCombinators.ReadP -- Copyright : (c) The University of Glasgow 2002 -- License : BSD-style (see the file libraries/base/LICENSE) --- +-- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : non-portable (local universal quantification) -- -- This is a library of parser combinators, originally written by Koen Claessen. --- It parses all alternatives in parallel, so it never keeps hold of +-- It parses all alternatives in parallel, so it never keeps hold of -- the beginning of the input string, a common source of space leaks with -- other parsers. The '(+++)' choice combinator is genuinely commutative; -- it makes no difference which branch is \"shorter\". @@ -23,17 +23,17 @@ ----------------------------------------------------------------------------- module Text.ParserCombinators.ReadP - ( + ( -- * The 'ReadP' type ReadP, - + -- * Primitive operations get, look, (+++), (<++), gather, - + -- * Other operations pfail, eof, @@ -234,9 +234,9 @@ gather :: ReadP a -> ReadP (String, a) -- ^ Transforms a parser into one that does the same, but -- in addition returns the exact characters read. -- IMPORTANT NOTE: 'gather' gives a runtime error if its first argument --- is built using any occurrences of readS_to_P. +-- is built using any occurrences of readS_to_P. gather (R m) - = R (\k -> gath id (m (\a -> return (\s -> k (s,a))))) + = R (\k -> gath id (m (\a -> return (\s -> k (s,a))))) where gath :: (String -> String) -> P (String -> P b) -> P b gath l (Get f) = Get (\c -> gath (l.(c:)) (f c)) @@ -259,8 +259,8 @@ char c = satisfy (c ==) eof :: ReadP () -- ^ Succeeds iff we are at the end of input -eof = do { s <- look - ; if null s then return () +eof = do { s <- look + ; if null s then return () else pfail } string :: String -> ReadP String @@ -477,12 +477,12 @@ Here follow the properties: > xs +<+ _ = xs > > prop_Gather s = -> forAll readPWithoutReadS $ \p -> +> forAll readPWithoutReadS $ \p -> > readP_to_S (gather p) s =~ -> [ ((pre,x::Int),s') -> | (x,s') <- readP_to_S p s -> , let pre = take (length s - length s') s -> ] +> [ ((pre,x::Int),s') +> | (x,s') <- readP_to_S p s +> , let pre = take (length s - length s') s +> ] > > prop_String_Yes this s = > readP_to_S (string this) (this ++ s) =~ diff --git a/libraries/base/Text/ParserCombinators/ReadPrec.hs b/libraries/base/Text/ParserCombinators/ReadPrec.hs index 52f4eafca9..027648d9e8 100644 --- a/libraries/base/Text/ParserCombinators/ReadPrec.hs +++ b/libraries/base/Text/ParserCombinators/ReadPrec.hs @@ -6,7 +6,7 @@ -- Module : Text.ParserCombinators.ReadPrec -- Copyright : (c) The University of Glasgow 2002 -- License : BSD-style (see the file libraries/base/LICENSE) --- +-- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : non-portable (uses Text.ParserCombinators.ReadP) @@ -113,7 +113,7 @@ reset :: ReadPrec a -> ReadPrec a reset (P f) = P (\_ -> f minPrec) prec :: Prec -> ReadPrec a -> ReadPrec a --- ^ @(prec n p)@ checks whether the precedence context is +-- ^ @(prec n p)@ checks whether the precedence context is -- less than or equal to @n@, and -- -- * if not, fails diff --git a/libraries/base/Text/Read.hs b/libraries/base/Text/Read.hs index 18c485fea1..1d08343e2c 100644 --- a/libraries/base/Text/Read.hs +++ b/libraries/base/Text/Read.hs @@ -6,7 +6,7 @@ -- Module : Text.Read -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) --- +-- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : non-portable (uses Text.ParserCombinators.ReadP) @@ -15,7 +15,7 @@ -- -- The "Text.Read" library is the canonical library to import for -- 'Read'-class facilities. For GHC only, it offers an extended and much --- improved 'Read' class, which constitutes a proposed alternative to the +-- improved 'Read' class, which constitutes a proposed alternative to the -- Haskell 2010 'Read'. In particular, writing parsers is easier, and -- the parsers are much more efficient. -- diff --git a/libraries/base/Text/Read/Lex.hs b/libraries/base/Text/Read/Lex.hs index 39ca46a33f..cdbcf4ad1d 100644 --- a/libraries/base/Text/Read/Lex.hs +++ b/libraries/base/Text/Read/Lex.hs @@ -164,7 +164,7 @@ lex = skipSpaces >> lexToken -- | /Since: 4.7.0.0/ expect :: Lexeme -> ReadP () -expect lexeme = do { skipSpaces +expect lexeme = do { skipSpaces ; thing <- lexToken ; if thing == lexeme then return () else pfail } |