renderIOWith :: PrettyPrintOptions -> Doc -> IO Text.Lazy.Text
renderIOWith opts (Doc _ blocks) = toLazyText <$> foldM helper "\n" blocks
  where
    helper m block = do
        t <- renderBlock opts block
        return (m <> fromLazyText t <> "\n")

-- |
-- Renders a 'Doc' without doing 'IO'
renderIOWith :: PrettyPrintOptions -> Doc -> IO Text.Lazy.Text
renderIOWith opts (Doc _ blocks) = toLazyText <$> foldM helper "\n" blocks
  where
    helper m block = do
        t <- renderBlock opts block
        return (m <> fromLazyText t <> "\n")

-- |
-- Renders a 'Doc' without doing 'IO'
renderIOWith opts (Doc _ blocks) = toLazyText <$> foldM helper "\n" blocks
  where
    helper m block = do
        t <- renderBlock opts block
        return (m <> fromLazyText t <> "\n")

-- |
-- Renders a 'Doc' without doing 'IO'