{-# LANGUAGE DefaultSignatures #-} module Frames.ShowCSV where import Data.Text (Text) import qualified Data.Text as T -- | Control the way values of a type are printed when serializing to -- a CSV stream. class ShowCSV a where showCSV :: a -> Text default showCSV :: Show a => a -> Text showCSV = String -> Text T.pack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String show instance ShowCSV Bool where instance ShowCSV Int where instance ShowCSV Double where instance ShowCSV Text where showCSV :: Text -> Text showCSV = forall a. a -> a id