diff options
Diffstat (limited to 'app/Render.hs')
-rw-r--r-- | app/Render.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Render.hs b/app/Render.hs index f4293c2..907ef15 100644 --- a/app/Render.hs +++ b/app/Render.hs @@ -12,6 +12,7 @@ module Render (<<<), (===), styled, + renderAsText, -- * Reporting styles Detailed (..), @@ -46,6 +47,12 @@ class Render a where default render :: Pretty a => a -> Doc AnsiStyle render = pretty +renderAsString :: Render a => a -> String +renderAsString = show . render + +renderAsText :: Render a => a -> T.Text +renderAsText = T.pack . renderAsString + instance Render (Doc AnsiStyle) where render = id |