--- old-style-scanner/doc/Examples.hs 2012-08-06 16:09:54.424699928 +0200 +++ new-style-scanner/doc/Examples.hs 2012-08-06 16:09:54.426699971 +0200 @@ -1,22 +1,20 @@ - -{-| +{- | This is a description starting with a missing blank between {- and | (that needs a matching -} for proper nesting). More than two blank lines (above and below) will be stripped off. -You should also leave a blank or newline before closing your comment.-} - +You should also leave a blank or newline before closing your comment. -} module Examples where import Data.Char -import Data.List( ) -- treated like applications -import Data.Maybe (Maybe ( .. )) -- treated like infix symbol +import Data.List () -- treated like applications +import Data.Maybe (Maybe (..)) -- treated like infix symbol numbers :: [Int] numbers = [ 1 .. ] -- space ok before "]" (no section) @@ -31,7 +29,7 @@ -- example for bad chars tabBeforeString :: String tabBeforeString = - " " + " " (\\) :: Eq a => [a] -> [a] -> [a] (\\) = error @@ -59,19 +57,19 @@ -} operatorAsPrefix :: Int -> Int -> Int -operatorAsPrefix = ( + ) +operatorAsPrefix = (+) noSpaceNeededBefore :: Int -> Int -noSpaceNeededBefore = (1 + ) +noSpaceNeededBefore = (1 +) noSpaceNeededAfter :: Int -> Int -noSpaceNeededAfter = ( + 1) +noSpaceNeededAfter = (+ 1) noSpaceNeededBetween :: ([a], ()) -noSpaceNeededBetween = ([ ], ( )) +noSpaceNeededBetween = ([], ()) multipleBlanks :: Char -multipleBlanks = ' ' -- but ok before comment +multipleBlanks = ' ' -- but ok before comment breakLineAfterOf :: [a] -> [a] breakLineAfterOf l = case l of [] -> [] @@ -89,36 +87,36 @@ unaryMinus = -1 -- ok with or without space binaryMinus :: Int -binaryMinus = 3-1 +binaryMinus = 3 - 1 data D = D { d :: !Int } -- the "!" needs no space here otherBinary :: Int -otherBinary = 1+2 +otherBinary = 1 + 2 spacesBetweenArguments :: (Int -> Int) -> Int -> Int -spacesBetweenArguments f x = f(x + 1) +spacesBetweenArguments f x = f (x + 1) spaceAfterLambda :: (((Int -> Int) -> Int) -> Int) -> Int -spaceAfterLambda f = f (\x -> x 1) +spaceAfterLambda f = f (\ x -> x 1) -- there may be a space before the lambda possibleSplice :: (Char -> a) -> Char -> a -possibleSplice f y = f $(y :: Char) +possibleSplice f y = f $ (y :: Char) -- list comprehensions, with e,d,p,t clashing with TH possibleThQuote :: String -possibleThQuote = [e| e <- "abc"] +possibleThQuote = [e | e <- "abc"] plainListComprehensions :: String -plainListComprehensions = [a| a <- "abc"] +plainListComprehensions = [a | a <- "abc"] {- Some comments here + + -} --- -{- -} --- missing final newline \ No newline at end of file +-- missing final newline