Skip to content

Commit 21cffe7

Browse files
committed
Fix-whitespace
1 parent e0e005d commit 21cffe7

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

Setup.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
import Distribution.Simple
22
main = defaultMain
33

4-
5-
6-
7-
8-

examples/NamedBasedExplicitDecode.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ main = do
1818
case decodeByNameWithP valueParse defaultDecodeOptions csvData of
1919
Left err -> putStrLn err
2020
Right (_, v) -> V.forM_ v $ \ p ->
21-
putStrLn $ name p ++ " earns " ++ show (salary p) ++ " dollars"
21+
putStrLn $ name p ++ " earns " ++ show (salary p) ++ " dollars"

src/Data/Csv.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,43 +151,43 @@ import Data.Csv.Types
151151
--
152152
-- In practice, the return type of 'decode' rarely needs to be given,
153153
-- as it can often be inferred from the context.
154-
--
154+
--
155155
-- Demonstration of reading from a CSV file/ writing to a CSV file
156156
-- using the incremental API:
157157
--
158158
-- > {-#LANGUAGE DeriveGeneric#-}
159159
-- > {-#LANGUAGE OverloadedStrings#-}
160160
-- > {-#LANGUAGE BangPatterns#-}
161-
-- >
161+
-- >
162162
-- > import Data.ByteString (ByteString, hGetSome, empty)
163163
-- > import qualified Data.ByteString.Lazy as BL
164164
-- > import GHC.Generics
165165
-- > import Data.Csv.Incremental
166-
-- > import Data.Csv (FromRecord, ToRecord)
166+
-- > import Data.Csv (FromRecord, ToRecord)
167167
-- > import Data.Monoid ((<>), mempty)
168168
-- > import System.IO
169169
-- > import System.Exit (exitFailure)
170-
-- >
170+
-- >
171171
-- > data Person = Person {
172172
-- > name :: ByteString,
173173
-- > age :: Int
174174
-- > } deriving (Show, Eq, Generic)
175-
-- >
175+
-- >
176176
-- > instance FromRecord Person
177177
-- > instance ToRecord Person
178-
-- >
178+
-- >
179179
-- > persons = [Person "John Doe" 19, Person "Smith" 20]
180-
-- >
180+
-- >
181181
-- > writeToFile :: IO ()
182182
-- > writeToFile = BL.writeFile "persons.csv" $ encode $ foldr (<>) mempty (map encodeRecord persons)
183-
-- >
183+
-- >
184184
-- > feed :: (ByteString -> Parser Person) -> Handle -> IO (Parser Person)
185185
-- > feed k csvFile = do
186186
-- > isEof <- hIsEOF csvFile
187187
-- > if isEof
188188
-- > then return $ k empty
189189
-- > else k `fmap` hGetSome csvFile 4096
190-
-- >
190+
-- >
191191
-- > readFromFile :: IO ()
192192
-- > readFromFile = withFile "persons.csv" ReadMode $ \csvFile -> do
193193
-- > let loop !_ (Fail _ errMsg) = putStrLn errMsg >> exitFailure

0 commit comments

Comments
 (0)