{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module TextShow.Text.XHtml () where
import Prelude ()
import Prelude.Compat
import Text.XHtml.Frameset (Html, HtmlAttr, HotLink,
htmlAttrPair, renderHtmlFragment)
import Text.XHtml.Table (HtmlTable)
import TextShow (TextShow(..), FromStringShow(..), fromString, singleton)
import TextShow.TH (deriveTextShow)
instance TextShow Html where
showb = fromString . renderHtmlFragment
{-# INLINE showb #-}
showbList = mconcat . map showb
{-# INLINE showbList #-}
instance TextShow HtmlAttr where
showb ha = case htmlAttrPair ha of
(str, val) -> fromString str <> singleton '=' <> showb val
{-# INLINE showb #-}
$(deriveTextShow ''HotLink)
instance TextShow HtmlTable where
showb = showb . FromStringShow
{-# INLINE showb #-}