cassava-records 0.1.0.2 → 0.1.0.3
raw patch · 3 files changed
+6/−66 lines, 3 filesdep −lensdep −pptable
Dependencies removed: lens, pptable
Files
- ChangeLog.md +4/−0
- app/Main.hs +0/−42
- cassava-records.cabal +2/−24
ChangeLog.md view
@@ -3,3 +3,7 @@ ## 0.1.0.2 - Fix README.md++## 0.1.0.3++- Remove Main.hs from uploaded distribution. Causes doc generation to fail
− app/Main.hs
@@ -1,42 +0,0 @@-{-#LANGUAGE TemplateHaskell#-}-{-#LANGUAGE DeriveGeneric #-}-{-#LANGUAGE ScopedTypeVariables #-}-{-#LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE DeriveDataTypeable #-}--module Main where--import Data.Cassava.Records-import Data.Csv-import qualified Data.ByteString.Lazy as BL-import Data.Vector as V-import Data.Text as DT-import qualified Text.PrettyPrint.Tabulate as T-import Language.Haskell.TH--- import Control.Lens hiding (element)--$(makeCsvRecord "Salaries" "data/salaries_simple.csv" "_" commaOptions)--- $(makeInstance "Salaries")--$(makeCsvRecord "SalariesMixed" "data/salaries_mixed_input.csv" "_" commaOptions)-$(makeInstance "SalariesMixed")---- the following instance is not required, if $(makeInstance) call is spliced in-myOptions :: Options-myOptions = defaultOptions { fieldLabelModifier = rmUnderscore }- where- rmUnderscore ('_':str) = DT.unpack . DT.toUpper . DT.pack $ str- rmUnderscore str = str--instance ToNamedRecord Salaries where- toNamedRecord = genericToNamedRecord myOptions--instance FromNamedRecord Salaries where- parseNamedRecord = genericParseNamedRecord myOptions--main :: IO ()-main = do- v <- loadData "data/salaries_simple.csv" :: IO (V.Vector Salaries)- v1 <- loadData "data/salaries_mixed_input.csv" :: IO (V.Vector SalariesMixed)- putStrLn . show $ v- putStrLn . show $ v1
cassava-records.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: a0ddcd21e9c960a2db98c19cc741cf634581aeb7f79e42779e7c90283f4903f0+-- hash: b49e886afbdb22ebcf366cd7146a2dff5a316fe2a524063fa87463bcf65eccfd name: cassava-records-version: 0.1.0.2+version: 0.1.0.3 synopsis: Auto-generation of records data type. description: cassava-records library helps in auto-creating record data types using Template Haskell by inferring types from the columns of a csv or compatible input file. The record and type classes instances generated can be seamlessly used with cassava(the haskell csv reader library) to load the data into these record types without dealing with any other level of abstraction. Please see README on Github at <https://github.com/gdevanla/cassava-records#readme>@@ -44,28 +44,6 @@ exposed-modules: Data.Cassava.Internal.RecordBuilder Data.Cassava.Records- other-modules:- Paths_cassava_records- default-language: Haskell2010--executable cassava-records-exe- main-is: Main.hs- hs-source-dirs:- app- ghc-options: -threaded -rtsopts -with-rtsopts=-N- build-depends:- attoparsec- , base >=4.7 && <5- , bytestring- , cassava- , cassava-records- , foldl- , lens- , pptable- , template-haskell- , text- , unordered-containers- , vector other-modules: Paths_cassava_records default-language: Haskell2010