Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type AttrName = Text
- data Attr a
- data IsEscaped
- data SomeText
- data Markup' a
- data Stream a = ListS [s] !(FastMarkup (s -> a))
- unstream :: (FastMarkup a -> b) -> Stream a -> (b -> c -> c) -> c -> c
- data a :$ b = (:$) (FastMarkup (a -> b)) a
- data FastMarkup a
- data Markup'F a r
- plateFM :: Monad m => (FastMarkup a -> m (FastMarkup a)) -> FastMarkup a -> m (FastMarkup a)
- compileAttrs :: forall a. Vector (Attr a) -> (Builder, Vector (Attr a))
- escapeText :: Text -> Builder
- escape :: SomeText -> Builder
- toText :: Builder -> Text
- fastAttr :: Attr a -> FastMarkup a
- fast :: Markup' a -> FastMarkup a
- immediateRender :: FastMarkup a -> Maybe Builder
- munch :: Vector (FastMarkup a) -> Vector (FastMarkup a)
- flatten :: FastMarkup a -> FastMarkup a
- strictify :: FastMarkup a -> FastMarkup a
- compile_ :: Markup' a -> FastMarkup a
- recompile :: FastMarkup a -> FastMarkup a
- unlayer :: FastMarkup (FastMarkup a) -> FastMarkup a
- renderM :: Monad m => (a -> m Builder) -> FastMarkup a -> m Builder
- renderMs :: Monad m => (a -> m (FastMarkup Void)) -> FastMarkup a -> m Builder
- render :: FastMarkup Void -> Builder
- class Render a m where
- newtype RenderToFastMarkup a = RenderToFastMarkup {
- unToFastMarkup :: a
- class ToFastMarkup a where
- newtype AsDecimal a = AsDecimal {
- asDecimal :: a
- newtype AsHex a = AsHex {
- asHex :: a
- newtype AsRealFloat a = AsRealFloat {
- asRealFloat :: a
Documentation
A very simple HTML DSL
ListS [s] !(FastMarkup (s -> a)) |
unstream :: (FastMarkup a -> b) -> Stream a -> (b -> c -> c) -> c -> c Source #
(:$) (FastMarkup (a -> b)) a infixl 0 |
data FastMarkup a Source #
Bunch !(Vector (FastMarkup a)) | |
FStream !(Stream a) | |
FHole !IsEscaped !a | |
FLText Text | |
FSText !Text | |
FBuilder !Builder | |
FEmpty | |
FDeep (FastMarkup (FastMarkup a)) |
Functor FastMarkup Source # | |
Foldable FastMarkup Source # | |
Eq a => Eq (FastMarkup a) Source # | |
Show a => Show (FastMarkup a) Source # | |
Generic (FastMarkup a) Source # | |
Monoid (FastMarkup a) Source # | |
NFData a => NFData (FastMarkup a) Source # | |
(Render a m, Monad m) => Render (FastMarkup a) m Source # | |
type Rep (FastMarkup a) Source # | |
plateFM :: Monad m => (FastMarkup a -> m (FastMarkup a)) -> FastMarkup a -> m (FastMarkup a) Source #
escapeText :: Text -> Builder Source #
fastAttr :: Attr a -> FastMarkup a Source #
fast :: Markup' a -> FastMarkup a Source #
immediateRender :: FastMarkup a -> Maybe Builder Source #
Look for an immediate string-like term and render that
munch :: Vector (FastMarkup a) -> Vector (FastMarkup a) Source #
Flatten a vector of 'FastMarkup. String-like terms that are next to eachother should be combined
flatten :: FastMarkup a -> FastMarkup a Source #
Recursively flatten FastMarkup
until doing so does nothing
strictify :: FastMarkup a -> FastMarkup a Source #
Run all Text builders
compile_ :: Markup' a -> FastMarkup a Source #
Compile Markup''
recompile :: FastMarkup a -> FastMarkup a Source #
unlayer :: FastMarkup (FastMarkup a) -> FastMarkup a Source #
renderM :: Monad m => (a -> m Builder) -> FastMarkup a -> m Builder Source #
Render FastMarkup
renderMs :: Monad m => (a -> m (FastMarkup Void)) -> FastMarkup a -> m Builder Source #
Render FastMarkup
by recursively rendering any sub-markup.
render :: FastMarkup Void -> Builder Source #
Render FastMarkup
that has no holes.
class Render a m where Source #
Monad m => Render Void m Source # | |
Monad m => Render Text m Source # | |
Monad m => Render Text m Source # | |
Monad m => Render Builder m Source # | |
(Render a m, Monad m) => Render (FastMarkup a) m Source # | |
(ToFastMarkup a, Monad m) => Render (RenderToFastMarkup a) m Source # | |
(Render b m, (~) (* -> *) m' (ReaderT * a m)) => Render (a -> b) m' Source # | |
(Monad m, Render b m) => Render ((:$) a b) m Source # | Defer application of an argument to rendering |
newtype RenderToFastMarkup a Source #
(ToFastMarkup a, Monad m) => Render (RenderToFastMarkup a) m Source # | |
class ToFastMarkup a where Source #
toFastMarkup :: a -> FastMarkup b Source #
ToFastMarkup Text Source # | |
ToFastMarkup Text Source # | |
ToFastMarkup Builder Source # | |
RealFloat a => ToFastMarkup (AsRealFloat a) Source # | |
Integral a => ToFastMarkup (AsHex a) Source # | |
Integral a => ToFastMarkup (AsDecimal a) Source # | |
Integral a => ToFastMarkup (AsDecimal a) Source # | |
newtype AsRealFloat a Source #
AsRealFloat | |
|
RealFloat a => ToFastMarkup (AsRealFloat a) Source # | |