module Web.Hyperbole.View.Render
  ( renderText
  , renderLazyByteString
  ) where

import Data.ByteString.Lazy qualified as BL
import Data.Text (Text)
import Web.Atomic.Render qualified as Atomic
import Web.Hyperbole.View.Types (View, runView)


renderText :: View () () -> Text
renderText :: View () () -> Text
renderText = Html () -> Text
Atomic.renderText (Html () -> Text) -> (View () () -> Html ()) -> View () () -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> View () () -> Html ()
forall c a. c -> View c a -> Html a
runView ()


renderLazyByteString :: View () () -> BL.ByteString
renderLazyByteString :: View () () -> ByteString
renderLazyByteString = Html () -> ByteString
Atomic.renderLazyByteString (Html () -> ByteString)
-> (View () () -> Html ()) -> View () () -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> View () () -> Html ()
forall c a. c -> View c a -> Html a
runView ()