module DataFrame.Typed.TH.CSV (
deriveSchemaFromCsvFile,
deriveSchemaFromCsvFileWith,
) where
import Control.Monad.IO.Class (liftIO)
import Language.Haskell.TH
import qualified DataFrame.IO.CSV as D
import DataFrame.Typed.TH.Records (deriveSchema)
deriveSchemaFromCsvFile :: String -> String -> DecsQ
deriveSchemaFromCsvFile :: String -> String -> DecsQ
deriveSchemaFromCsvFile = ReadOptions -> String -> String -> DecsQ
deriveSchemaFromCsvFileWith ReadOptions
D.defaultReadOptions
deriveSchemaFromCsvFileWith :: D.ReadOptions -> String -> String -> DecsQ
deriveSchemaFromCsvFileWith :: ReadOptions -> String -> String -> DecsQ
deriveSchemaFromCsvFileWith ReadOptions
opts String
typeName String
path = do
DataFrame
df <- IO DataFrame -> Q DataFrame
forall a. IO a -> Q a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (ReadOptions -> String -> IO DataFrame
D.readSeparated ReadOptions
opts String
path)
String -> DataFrame -> DecsQ
deriveSchema String
typeName DataFrame
df