loadTransactionFile :: FilePath -> IO (Either LoadError [Transaction])
loadTransactionFile path = fmap (join . (parseTs <$> scheme <*>)) input
  where scheme = injectNothingAs UnknownScheme $ selectScheme path
        input = injectNothingAs FileNotFound <$> loadFile path
        parseTs sch inp = injectErrorAs InvalidCSV (parseTransactions sch inp)

-- |Deserializes a string of transaction according to specified scheme.
loadTransactionFile :: FilePath -> IO (Either LoadError [Transaction])
loadTransactionFile path = fmap (join . (parseTs <$> scheme <*>)) input
  where scheme = injectNothingAs UnknownScheme $ selectScheme path
        input = injectNothingAs FileNotFound <$> loadFile path
        parseTs sch inp = injectErrorAs InvalidCSV (parseTransactions sch inp)

-- |Deserializes a string of transaction according to specified scheme.
loadTransactionFile path = fmap (join . (parseTs <$> scheme <*>)) input
  where scheme = injectNothingAs UnknownScheme $ selectScheme path
        input = injectNothingAs FileNotFound <$> loadFile path
        parseTs sch inp = injectErrorAs InvalidCSV (parseTransactions sch inp)

-- |Deserializes a string of transaction according to specified scheme.