Commit acb313ad authored by Jan Stolarek's avatar Jan Stolarek
Browse files

Trailing whitespaces

parent 1b608a0d
......@@ -15,7 +15,7 @@
-- Module : Control.Concurrent
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
-- Portability : non-portable (concurrency)
......@@ -50,7 +50,7 @@ module Control.Concurrent (
-- * Scheduling
-- $conc_scheduling
-- $conc_scheduling
yield,
-- ** Blocking
......@@ -171,7 +171,7 @@ In GHC, threads may also communicate via exceptions.
will print either @aaaaaaaaaaaaaa...@ or @bbbbbbbbbbbb...@,
instead of some random interleaving of @a@s and @b@s. In
practice, cooperative multitasking is sufficient for writing
simple graphical user interfaces.
simple graphical user interfaces.
-}
{- $blocking
......@@ -228,7 +228,7 @@ called the function). Also, the @main@ action of every Haskell program is
run in a bound thread.
Why do we need this? Because if a foreign library is called from a thread
created using 'forkIO', it won't have access to any /thread-local state/ -
created using 'forkIO', it won't have access to any /thread-local state/ -
state variables that have specific values for each OS thread
(see POSIX's @pthread_key_create@ or Win32's @TlsAlloc@). Therefore, some
libraries (OpenGL, for example) will not work from a thread created using
......@@ -258,7 +258,7 @@ waiting for the results in the main thread.
foreign import ccall rtsSupportsBoundThreads :: Bool
{- |
{- |
Like 'forkIO', this sparks off a new thread to run the 'IO'
computation passed as the first argument, and returns the 'ThreadId'
of the newly created thread.
......@@ -329,7 +329,7 @@ isCurrentThreadBound = IO $ \ s# ->
(# s2#, flg #) -> (# s2#, not (flg ==# 0#) #)
{- |
{- |
Run the 'IO' computation passed as the first argument. If the calling thread
is not /bound/, a bound thread is created temporarily. @runInBoundThread@
doesn't finish until the 'IO' computation finishes.
......@@ -354,7 +354,7 @@ runInBoundThread action
unsafeResult
| otherwise = failNonThreaded
{- |
{- |
Run the 'IO' computation passed as the first argument. If the calling thread
is /bound/, an unbound thread is created temporarily using 'forkIO'.
@runInBoundThread@ doesn't finish until the 'IO' computation finishes.
......@@ -457,7 +457,7 @@ threadWaitReadSTM fd
-- is an IO action that can be used to deregister interest
-- in the file descriptor.
threadWaitWriteSTM :: Fd -> IO (STM (), IO ())
threadWaitWriteSTM fd
threadWaitWriteSTM fd
#ifdef mingw32_HOST_OS
| threaded = do v <- newTVarIO Nothing
mask_ $ void $ forkIO $ do result <- try (waitFd fd 1)
......@@ -573,7 +573,7 @@ foreign import ccall safe "fdReady"
> children :: MVar [MVar ()]
> children = unsafePerformIO (newMVar [])
>
>
> waitForChildren :: IO ()
> waitForChildren = do
> cs <- takeMVar children
......
......@@ -6,7 +6,7 @@
-- Module : Data.Bits
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
-- Portability : portable
......@@ -19,7 +19,7 @@
--
-----------------------------------------------------------------------------
module Data.Bits (
module Data.Bits (
Bits(
(.&.), (.|.), xor,
complement,
......@@ -63,7 +63,7 @@ infixl 5 .|.
{-# DEPRECATED bitSize "Use bitSizeMaybe or finiteBitSize instead" #-} -- deprecated in 7.8
{-|
{-|
The 'Bits' class defines bitwise operations over integral types.
* Bits are numbered from 0 with bit 0 being the least
......@@ -393,5 +393,5 @@ own to enable constant folding; for example 'shift':
__DEFAULT -> Main.$wfold (+# ww_sOb 56) (+# wild_XM 1);
10000000 -> ww_sOb
}
-}
-}
......@@ -9,13 +9,13 @@
-- Module : GHC.Arr
-- Copyright : (c) The University of Glasgow, 1994-2000
-- License : see libraries/base/LICENSE
--
--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC extensions)
--
-- GHC\'s array implementation.
--
--
-----------------------------------------------------------------------------
-- #hide
......@@ -105,7 +105,7 @@ class (Ord a) => Ix a where
-- the same code, but using indexError instead of hopelessIndexError
-- Reason: we have 'Show' at the instances
{-# INLINE index #-} -- See Note [Inlining index]
index b i | inRange b i = unsafeIndex b i
index b i | inRange b i = unsafeIndex b i
| otherwise = hopelessIndexError
unsafeIndex b i = index b i
......@@ -137,9 +137,9 @@ hence is empty
Note [Inlining index]
~~~~~~~~~~~~~~~~~~~~~
We inline the 'index' operation,
We inline the 'index' operation,
* Partly because it generates much faster code
* Partly because it generates much faster code
(although bigger); see Trac #1216
* Partly because it exposes the bounds checks to the simplifier which
......@@ -151,20 +151,20 @@ Note [Double bounds-checking of index values]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you index an array, a!x, there are two possible bounds checks we might make:
(A) Check that (inRange (bounds a) x) holds.
(A) Check that (inRange (bounds a) x) holds.
(A) is checked in the method for 'index'
(B) Check that (index (bounds a) x) lies in the range 0..n,
(B) Check that (index (bounds a) x) lies in the range 0..n,
where n is the size of the underlying array
(B) is checked in the top-level function (!), in safeIndex.
Of course it *should* be the case that (A) holds iff (B) holds, but that
Of course it *should* be the case that (A) holds iff (B) holds, but that
is a property of the particular instances of index, bounds, and inRange,
so GHC cannot guarantee it.
* If you do (A) and not (B), then you might get a seg-fault,
* If you do (A) and not (B), then you might get a seg-fault,
by indexing at some bizarre location. Trac #1610
* If you do (B) but not (A), you may get no complaint when you index
......@@ -366,7 +366,7 @@ instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1,a2,a3,a4,a5) where
inRange ((l1,l2,l3,l4,l5),(u1,u2,u3,u4,u5)) (i1,i2,i3,i4,i5) =
inRange (l1,u1) i1 && inRange (l2,u2) i2 &&
inRange (l3,u3) i3 && inRange (l4,u4) i4 &&
inRange (l3,u3) i3 && inRange (l4,u4) i4 &&
inRange (l5,u5) i5
-- Default method for index
......@@ -483,16 +483,16 @@ unsafeArray' (l,u) n@(I# n#) ies = runST (ST $ \s1# ->
{-# INLINE fill #-}
fill :: MutableArray# s e -> (Int, e) -> STRep s a -> STRep s a
-- NB: put the \s after the "=" so that 'fill'
-- inlines when applied to three args
fill marr# (I# i#, e) next
= \s1# -> case writeArray# marr# i# e s1# of
s2# -> next s2#
-- NB: put the \s after the "=" so that 'fill'
-- inlines when applied to three args
fill marr# (I# i#, e) next
= \s1# -> case writeArray# marr# i# e s1# of
s2# -> next s2#
{-# INLINE done #-}
done :: Ix i => i -> i -> Int -> MutableArray# s e -> STRep s (Array i e)
-- See NB on 'fill'
done l u n marr#
done l u n marr#
= \s1# -> case unsafeFreezeArray# marr# s1# of
(# s2#, arr# #) -> (# s2#, Array l u n arr# #)
......@@ -551,7 +551,7 @@ safeIndex (l,u) n i = let i' = index (l,u) i
lessSafeIndex :: Ix i => (i, i) -> Int -> i -> Int
-- See Note [Double bounds-checking of index values]
-- Do only (A), the semantic check
lessSafeIndex (l,u) _ i = index (l,u) i
lessSafeIndex (l,u) _ i = index (l,u) i
-- Don't inline this long error message everywhere!!
badSafeIndex :: Int -> Int -> Int
......@@ -776,7 +776,7 @@ newSTArray (l,u) initial = ST $ \s1# ->
(# s2#, STArray l u n marr# #) }}
{-# INLINE boundsSTArray #-}
boundsSTArray :: STArray s i e -> (i,i)
boundsSTArray :: STArray s i e -> (i,i)
boundsSTArray (STArray l u _ _) = (l,u)
{-# INLINE numElementsSTArray #-}
......@@ -794,12 +794,12 @@ unsafeReadSTArray (STArray _ _ _ marr#) (I# i#)
= ST $ \s1# -> readArray# marr# i# s1#
{-# INLINE writeSTArray #-}
writeSTArray :: Ix i => STArray s i e -> i -> e -> ST s ()
writeSTArray :: Ix i => STArray s i e -> i -> e -> ST s ()
writeSTArray marr@(STArray l u n _) i e =
unsafeWriteSTArray marr (safeIndex (l,u) n i) e
{-# INLINE unsafeWriteSTArray #-}
unsafeWriteSTArray :: Ix i => STArray s i e -> Int -> e -> ST s ()
unsafeWriteSTArray :: Ix i => STArray s i e -> Int -> e -> ST s ()
unsafeWriteSTArray (STArray _ _ _ marr#) (I# i#) e = ST $ \s1# ->
case writeArray# marr# i# e s1# of
s2# -> (# s2#, () #)
......
......@@ -8,13 +8,13 @@
-- Module : GHC.Enum
-- Copyright : (c) The University of Glasgow, 1992-2002
-- License : see libraries/base/LICENSE
--
--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC extensions)
--
-- The 'Enum' and 'Bounded' classes.
--
--
-----------------------------------------------------------------------------
#include "MachDeps.h"
......@@ -67,14 +67,14 @@ class Bounded a where
-- whose constructors have no fields). The nullary constructors are
-- assumed to be numbered left-to-right by 'fromEnum' from @0@ through @n-1@.
-- See Chapter 10 of the /Haskell Report/ for more details.
--
--
-- For any type that is an instance of class 'Bounded' as well as 'Enum',
-- the following should hold:
--
-- * The calls @'succ' 'maxBound'@ and @'pred' 'minBound'@ should result in
-- a runtime error.
--
-- * 'fromEnum' and 'toEnum' should give a runtime error if the
--
-- * 'fromEnum' and 'toEnum' should give a runtime error if the
-- result value is not representable in the result type.
-- For example, @'toEnum' 7 :: 'Bool'@ is an error.
--
......@@ -120,7 +120,7 @@ boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]
boundedEnumFrom n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)]
boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]
boundedEnumFromThen n1 n2
boundedEnumFromThen n1 n2
| i_n2 >= i_n1 = map toEnum [i_n1, i_n2 .. fromEnum (maxBound `asTypeOf` n1)]
| otherwise = map toEnum [i_n1, i_n2 .. fromEnum (minBound `asTypeOf` n1)]
where
......@@ -370,10 +370,10 @@ instance Enum Char where
{-# INLINE enumFromTo #-}
enumFromTo (C# x) (C# y) = eftChar (ord# x) (ord# y)
{-# INLINE enumFromThen #-}
enumFromThen (C# x1) (C# x2) = efdChar (ord# x1) (ord# x2)
{-# INLINE enumFromThenTo #-}
enumFromThenTo (C# x1) (C# x2) (C# y) = efdtChar (ord# x1) (ord# x2) (ord# y)
......@@ -471,7 +471,7 @@ go_dn_char_list x0 delta lim
%* *
%*********************************************************
Be careful about these instances.
Be careful about these instances.
(a) remember that you have to count down as well as up e.g. [13,12..0]
(b) be careful of Int overflow
(c) remember that Int is bounded, so [1..] terminates at maxInt
......@@ -482,7 +482,7 @@ instance Bounded Int where
maxBound = maxInt
instance Enum Int where
succ x
succ x
| x == maxBound = error "Prelude.Enum.succ{Int}: tried to take `succ' of maxBound"
| otherwise = x + 1
pred x
......@@ -508,7 +508,7 @@ instance Enum Int where
-----------------------------------------------------
-- eftInt and eftIntFB deal with [a..b], which is the
-- eftInt and eftIntFB deal with [a..b], which is the
-- most common form, so we take a lot of care
-- In particular, we have rules for deforestation
......
......@@ -6,7 +6,7 @@
-- Module : GHC.Exts
-- Copyright : (c) The University of Glasgow 2002
-- License : see libraries/base/LICENSE
--
--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
......@@ -59,7 +59,7 @@ module GHC.Exts
-- * The Constraint kind
Constraint,
-- * Overloaded lists
IsList(..)
) where
......@@ -124,7 +124,7 @@ traceEvent = Debug.Trace.traceEventIO
* *
********************************************************************** -}
-- Annotating a type with NoSpecConstr will make SpecConstr
-- Annotating a type with NoSpecConstr will make SpecConstr
-- not specialise for arguments of that type.
-- This data type is defined here, rather than in the SpecConstr module
......@@ -147,11 +147,11 @@ class IsList l where
-- | The 'Item' type function returns the type of items of the structure
-- @l@.
type Item l
-- | The 'fromList' function constructs the structure @l@ from the given
-- list of @Item l@
fromList :: [Item l] -> l
-- | The 'fromListN' function takes the input list's length as a hint. Its
-- behaviour should be equivalent to 'fromList'. The hint can be used to
-- construct the structure @l@ more efficiently compared to 'fromList'. If
......@@ -159,9 +159,9 @@ class IsList l where
-- 'fromListN' is not specified.
fromListN :: Int -> [Item l] -> l
fromListN _ = fromList
-- | The 'toList' function extracts a list of @Item l@ from the structure @l@.
-- It should satisfy fromList . toList = id.
-- It should satisfy fromList . toList = id.
toList :: l -> [Item l]
instance IsList [a] where
......
......@@ -9,7 +9,7 @@
-- Module : GHC.IO.Exception
-- Copyright : (c) The University of Glasgow, 2009
-- License : see libraries/base/LICENSE
--
--
-- Maintainer : libraries@haskell.org
-- Stability : internal
-- Portability : non-portable
......@@ -212,7 +212,7 @@ ioException :: IOException -> IO a
ioException err = throwIO err
-- | Raise an 'IOError' in the 'IO' monad.
ioError :: IOError -> IO a
ioError :: IOError -> IO a
ioError = ioException
-- ---------------------------------------------------------------------------
......@@ -232,7 +232,7 @@ type IOError = IOException
-- flagged.
data IOException
= IOError {
ioe_handle :: Maybe Handle, -- the handle used by the action flagging
ioe_handle :: Maybe Handle, -- the handle used by the action flagging
-- the error.
ioe_type :: IOErrorType, -- what it was.
ioe_location :: String, -- location.
......@@ -245,7 +245,7 @@ data IOException
instance Exception IOException
instance Eq IOException where
(IOError h1 e1 loc1 str1 en1 fn1) == (IOError h2 e2 loc2 str2 en2 fn2) =
(IOError h1 e1 loc1 str1 en1 fn1) == (IOError h2 e2 loc2 str2 en2 fn2) =
e1==e2 && str1==str2 && h1==h2 && loc1==loc2 && en1==en2 && fn1==fn2
-- | An abstract type that contains a value for each variant of 'IOError'.
......@@ -303,7 +303,7 @@ instance Show IOErrorType where
-- The 'fail' method of the 'IO' instance of the 'Monad' class raises a
-- 'userError', thus:
--
-- > instance Monad IO where
-- > instance Monad IO where
-- > ...
-- > fail s = ioError (userError s)
--
......@@ -323,7 +323,7 @@ instance Show IOException where
(case loc of
"" -> id
_ -> showString loc . showString ": ") .
showsPrec p iot .
showsPrec p iot .
(case s of
"" -> id
_ -> showString " (" . showString s . showString ")")
......@@ -337,7 +337,7 @@ assertError str predicate v
| otherwise = throw (AssertionFailed (untangle str "Assertion failed"))
unsupportedOperation :: IOError
unsupportedOperation =
unsupportedOperation =
(IOError Nothing UnsupportedOperation ""
"Operation is not supported" Nothing Nothing)
......
......@@ -8,7 +8,7 @@
-- Module : GHC.List
-- Copyright : (c) The University of Glasgow 1994-2002
-- License : see libraries/base/LICENSE
--
--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
......@@ -63,12 +63,12 @@ head [] = badHead
badHead :: a
badHead = errorEmptyList "head"
-- This rule is useful in cases like
-- This rule is useful in cases like
-- head [y | (x,y) <- ps, x==t]
{-# RULES
"head/build" forall (g::forall b.(a->b->b)->b->b) .
head (build g) = g (\x _ -> x) badHead
"head/augment" forall xs (g::forall b. (a->b->b) -> b -> b) .
"head/augment" forall xs (g::forall b. (a->b->b) -> b -> b) .
head (augment g xs) = g (\x _ -> x) (head xs)
#-}
......@@ -226,7 +226,7 @@ foldr1 _ [] = errorEmptyList "foldr1"
scanr :: (a -> b -> b) -> b -> [a] -> [b]
scanr _ q0 [] = [q0]
scanr f q0 (x:xs) = f x q : qs
where qs@(q:_) = scanr f q0 xs
where qs@(q:_) = scanr f q0 xs
-- | 'scanr1' is a variant of 'scanr' that has no starting value argument.
......@@ -234,7 +234,7 @@ scanr1 :: (a -> a -> a) -> [a] -> [a]
scanr1 _ [] = []
scanr1 _ [x] = [x]
scanr1 f (x:xs) = f x q : qs
where qs@(q:_) = scanr1 f xs
where qs@(q:_) = scanr1 f xs
-- | 'iterate' @f x@ returns an infinite list of repeated applications
-- of @f@ to @x@:
......@@ -297,7 +297,7 @@ cycle xs = xs' where xs' = xs ++ xs'
takeWhile :: (a -> Bool) -> [a] -> [a]
takeWhile _ [] = []
takeWhile p (x:xs)
takeWhile p (x:xs)
| p x = x : takeWhile p xs
| otherwise = []
......@@ -449,11 +449,11 @@ splitAt (I# n#) ls
-- | 'span', applied to a predicate @p@ and a list @xs@, returns a tuple where
-- first element is longest prefix (possibly empty) of @xs@ of elements that
-- satisfy @p@ and second element is the remainder of the list:
--
--
-- > span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
-- > span (< 9) [1,2,3] == ([1,2,3],[])
-- > span (< 0) [1,2,3] == ([],[1,2,3])
--
--
-- 'span' @p xs@ is equivalent to @('takeWhile' p xs, 'dropWhile' p xs)@
span :: (a -> Bool) -> [a] -> ([a],[a])
......@@ -465,7 +465,7 @@ span p xs@(x:xs')
-- | 'break', applied to a predicate @p@ and a list @xs@, returns a tuple where
-- first element is longest prefix (possibly empty) of @xs@ of elements that
-- /do not satisfy/ @p@ and second element is the remainder of the list:
--
--
-- > break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
-- > break (< 9) [1,2,3] == ([],[1,2,3])
-- > break (> 9) [1,2,3] == ([1,2,3],[])
......@@ -517,9 +517,9 @@ or (x:xs) = x || or xs
{-# NOINLINE [1] or #-}
{-# RULES
"and/build" forall (g::forall b.(Bool->b->b)->b->b) .
"and/build" forall (g::forall b.(Bool->b->b)->b->b) .
and (build g) = g (&&) True
"or/build" forall (g::forall b.(Bool->b->b)->b->b) .
"or/build" forall (g::forall b.(Bool->b->b)->b->b) .
or (build g) = g (||) False
#-}
#endif
......@@ -549,9 +549,9 @@ all p (x:xs) = p x && all p xs
{-# NOINLINE [1] all #-}
{-# RULES
"any/build" forall p (g::forall b.(a->b->b)->b->b) .
"any/build" forall p (g::forall b.(a->b->b)->b->b) .
any p (build g) = g ((||) . p) False
"all/build" forall p (g::forall b.(a->b->b)->b->b) .
"all/build" forall p (g::forall b.(a->b->b)->b->b) .
all p (build g) = g ((&&) . p) True
#-}
#endif
......@@ -651,10 +651,10 @@ foldr2_right k _z y r (x:xs) = k x y (r xs)
-- foldr2 k z xs ys = foldr (foldr2_left k z) (\_ -> z) xs ys
-- foldr2 k z xs ys = foldr (foldr2_right k z) (\_ -> z) ys xs
{-# RULES
"foldr2/left" forall k z ys (g::forall b.(a->b->b)->b->b) .
"foldr2/left" forall k z ys (g::forall b.(a->b->b)->b->b) .
foldr2 k z (build g) ys = g (foldr2_left k z) (\_ -> z) ys
"foldr2/right" forall k z xs (g::forall b.(a->b->b)->b->b) .
"foldr2/right" forall k z xs (g::forall b.(a->b->b)->b->b) .
foldr2 k z xs (build g) = g (foldr2_right k z) (\_ -> z) xs
#-}
\end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment