spreadsheet 0.1.1.1 → 0.1.2
raw patch · 2 files changed
+21/−15 lines, 2 files
Files
- spreadsheet.cabal +6/−13
- src/Data/Spreadsheet.hs +15/−2
spreadsheet.cabal view
@@ -1,5 +1,5 @@ Name: spreadsheet-Version: 0.1.1.1+Version: 0.1.2 License: BSD3 License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de>@@ -8,30 +8,23 @@ Category: Data, Text Synopsis: Read and write spreadsheets from and to CSV files in a lazy way Description:- Read and write spreadsheets from and to CSV files in a lazy way.- See also the csv package on Hackage and+ Read and write spreadsheets from and to files+ containing comma separated values (CSV) in a lazy way.+ See also the+ csv package <http://hackage.haskell.org/package/csv> and <http://www.xoltar.org/languages/haskell.html>, <http://www.xoltar.org/languages/haskell/CSV.hs>. Both do not parse lazy. Reading from other source than plain 'String's could be easily added.-Tested-With: GHC==6.8.2+Tested-With: GHC==6.8.2, GHC==6.12.3 Cabal-Version: >=1.6 Build-Type: Simple Source-Repository head type: darcs location: http://code.haskell.org/~thielema/spreadsheet/ -Source-Repository this- type: darcs- location: http://code.haskell.org/~thielema/spreadsheet/- tag: 0.1.1.1- Flag splitBase description: Choose the new smaller, split-up base package.--Flag buildTests- description: Build test executables- default: False Library Build-Depends:
src/Data/Spreadsheet.hs view
@@ -2,7 +2,9 @@ T, -- * parsing fromString,+ fromStringWithRemainder, fromStringSimple,+ Parser.UserMessage, -- * formatting toString, toStringSimple,@@ -91,10 +93,21 @@ -} fromString :: Char -> Char -> String -> Async.Exceptional Parser.UserMessage T fromString qm sep str =- let (~(Async.Exceptional e table), rest) =- runState (CharSource.runString (parseTable qm sep)) str+ let (Async.Exceptional e (table, rest)) =+ fromStringWithRemainder qm sep str in Async.Exceptional (mplus e (toMaybe (not (null rest)) "junk after table")) table++{- |+@fromString qm sep text@ parses @text@ into a spreadsheet+and additionally returns text that follows after CSV formatted data.+-}+fromStringWithRemainder ::+ Char -> Char -> String -> Async.Exceptional Parser.UserMessage (T, String)+fromStringWithRemainder qm sep str =+ let (~(Async.Exceptional e table), rest) =+ runState (CharSource.runString (parseTable qm sep)) str+ in Async.Exceptional e (table, rest) toString :: Char -> Char -> T -> String