{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module TextShow.System.Time () where
import System.IO.Unsafe (unsafePerformIO)
import System.Time (ClockTime, TimeDiff, CalendarTime, Month, Day,
calendarTimeToString, toCalendarTime)
import TextShow (TextShow(..), fromString)
import TextShow.TH (deriveTextShow)
instance TextShow ClockTime where
showb = fromString . calendarTimeToString . unsafePerformIO . toCalendarTime
$(deriveTextShow ''TimeDiff)
$(deriveTextShow ''Month)
$(deriveTextShow ''Day)
$(deriveTextShow ''CalendarTime)