title: Parse CSV file into custom data type with csv-conduit
body: <p>I'm pretty confused about how to use csv-conduit with custom data types. I'd like to take a row of stock data such as this one:</p>
  
  <pre><code>Date,Open,High,Low,Close,Volume,Adj Close
  2017-02-10,2312.27002,2319.22998,2311.100098,2316.100098,3475020000,2316.100098
  </code></pre>
  
  <p>and parse that into the <code>StockInfo</code> type I have declared in my MWE below. I've gathered from the documentation that I need to make my <code>StockInfo</code> an instance of <code>FromNamedRecord</code>, <code>ToNamedRecord</code>, and <code>CSV ByteString</code>. I believe I have done so for the first two, but I do not understand how to implement the necessary methods for <code>CSV ByteString</code>. Any help would be greatly appreciated.</p>
  
  <p>MWE:</p>
  
  <pre><code>{-# LANGUAGE MultiParamTypeClasses #-}
  {-# LANGUAGE OverloadedStrings     #-}
  
  module Lib
      ( readStocks
      ) where
  
  import           Data.ByteString
  import           Data.Conduit
  import           Data.Conduit.Binary
  import           Data.Conduit.List           as CL
  import           Data.CSV.Conduit
  import           Data.CSV.Conduit.Conversion
  import           Data.Text                   (Text)
  import           Data.Vector
  import           System.IO
  
  readStocks :: FilePath -&gt; IO (Vector StockInfo)
  readStocks fp = readCSVFile defCSVSettings fp
  
  data StockInfo = StockInfo
    { date     :: !String
    , open     :: !Double
    , high     :: !Double
    , low      :: !Double
    , close    :: !Double
    , volume   :: !Integer
    , adjClose :: !Double
    }
  
  instance FromNamedRecord StockInfo where
    parseNamedRecord m =
      StockInfo &lt;$&gt;
      m .: "Date" &lt;*&gt;
      m .: "Open" &lt;*&gt;
      m .: "High" &lt;*&gt;
      m .: "Low" &lt;*&gt;
      m .: "Close" &lt;*&gt;
      m .: "Volume" &lt;*&gt;
      m .: "Adj Close"
  
  instance ToNamedRecord StockInfo where
    toNamedRecord (StockInfo date open high low close volume adjClose) =
      namedRecord [ "Date" .= date
                  , "Open" .= open
                  , "High" .= high
                  , "Low" .= low
                  , "Close" .= close
                  , "Volume" .= volume
                  , "Adj Close" .= adjClose
                  ]
  
  instance CSV ByteString StockInfo where
      -- rowToStr = undefined
      -- intoCSV = undefined
      -- fromCSV = undefined
  </code></pre>