xlsx-tabular 0.2.0 → 0.2.1
raw patch · 2 files changed
+12/−7 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Codec.Xlsx.Util.Tabular.Json: instance Data.Aeson.Types.FromJSON.FromJSON Codec.Xlsx.Types.CellValue
- Codec.Xlsx.Util.Tabular.Json: instance Data.Aeson.Types.ToJSON.ToJSON Codec.Xlsx.Types.CellValue
+ Codec.Xlsx.Util.Tabular.Json: instance Data.Aeson.Types.FromJSON.FromJSON Codec.Xlsx.Types.Common.CellValue
+ Codec.Xlsx.Util.Tabular.Json: instance Data.Aeson.Types.ToJSON.ToJSON Codec.Xlsx.Types.Common.CellValue
Files
- src/Codec/Xlsx/Util/Tabular.hs +11/−6
- xlsx-tabular.cabal +1/−1
src/Codec/Xlsx/Util/Tabular.hs view
@@ -133,13 +133,18 @@ & tabularHeadIx .~ i & tabularHeadLabel .~ t] toText _ = []- cix = fromList $ map (view tabularHeadIx) header'- rows = fmap rowValue (tail rs')- rowValue rvs = def- & tabularRowIx .~ fst rvs- & tabularRowCells .~ (map snd . filter f . snd) rvs+ ixs = map (view tabularHeadIx) header'+ rows = map rowValue (tail rs')+ rowValue (ix, row) = def+ & tabularRowIx .~ ix+ & tabularRowCells .~ insertMissingCells ixs row where- f = flip member cix . fst+ -- Insert empty cells when there is a header but no corresponding+ -- cell. This can happen if cells have no content nor formatting+ -- defined.+ insertMissingCells :: [Int] -> [(Int, Maybe CellValue)] -> [Maybe CellValue]+ insertMissingCells ixs cs = map (join . flip lookup cs) ixs+ -- |Pickup cells that has value from line getCells :: (Row -> Bool) -- ^ Predicate
xlsx-tabular.cabal view
@@ -1,5 +1,5 @@ name: xlsx-tabular-version: 0.2.0+version: 0.2.1 synopsis: Xlsx table decode utility description: Please see README.md homepage: http://github.com/kkazuo/xlsx-tabular#readme