diff options
Diffstat (limited to 'Biz/App.hs')
-rw-r--r-- | Biz/App.hs | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -4,7 +4,12 @@ {-# LANGUAGE NoImplicitPrelude #-} -- | General utils for apps -module Biz.App (CSS (..), Manifest (..)) where +module Biz.App + ( CSS (..), + Manifest (..), + HtmlApp (..), + ) +where import Alpha import Data.Aeson (ToJSON) @@ -14,7 +19,7 @@ import Network.HTTP.Media ( (//), (/:), ) -import Servant +import Servant.API (Accept (..), MimeRender (..)) newtype CSS = CSS { unCSS :: Text @@ -38,3 +43,12 @@ data Manifest = Manifest deriving (Show, Eq, Generic) instance ToJSON Manifest + +-- | A wrapper for an HTML page. You need to provide an orphan +-- 'Lucid.Base.ToHtml' instance in the Host module of your app. +-- +-- Ideally this would be captured in a Biz.App type, with overrides for head +-- elements, and we would wouldn't have to make the same basic orphan instance +-- for each app. +newtype HtmlApp a = HtmlApp a + deriving (Show, Eq) |