packages feed

lentil-0.1.1.3: src/Lentil/Export.hs

-----------------------------------------------------------------------------
-- |
-- Module      :  Lentil.Export
-- Copyright   :  © 2015 Francesco Ariis
-- License     :  GPLv3 (see the LICENSE file)
--
-- Exporting issues to various formats
-----------------------------------------------------------------------------

module Lentil.Export where

import Text.CSV
import Lentil.Types


---------------
-- FUNCTIONS --
---------------

issues2CSV :: [Issue] -> String
issues2CSV is = printCSV (firstLine : map i2r is)
    where firstLine = ["Filepath", "Row", "Description", "Tags"]
          i2r i     = [iFile i, show (iRow i),
                       iDesc i, tags2String (iTags i)]


-----------------
-- ANCILLARIES --
-----------------

tags2String :: [Tag] -> String
tags2String ts = unwords (map tagString ts)