suavemente-0.2.0.0: An applicative functor that seamlessly talks to HTML inputs.

Safe HaskellNone
LanguageHaskell2010

Web.Suavemente.Core

Synopsis

Documentation

showMarkup :: ToMarkup a => a -> String Source #

Get a String representation of a markup-able type. Useful for constructing elements via quasiquotation.

fromResult :: Result a -> a Source #

EXPLODE IF PARSING FAILS

getEvents Source #

Arguments

:: (Value -> Parser a) 
-> TVar a

The underlying TVar to publish changes to.

-> String

The name of the HTML input.

-> IO ()

Publish a change notification.

-> Stream (Of ChangeEvent) IO () 
-> Stream (Of ChangeEvent) IO () 

Construct an _iFold field for Inputs.

htmlPage :: (a -> Markup) -> String -> a -> Markup Source #

HTML code to inject into all Suave pages.

type API = Get '[HTML] Markup :<|> ("" :> ("ws" :> WebSocket)) Source #

The API for Suave pages.

type API2 = (Capture "resource" String :> Get '[HTML] Markup) :<|> (Capture "resource" String :> ("ws" :> WebSocket)) Source #

The API for Suavely pages.

suavemente :: (a -> Markup) -> Suave a -> IO () Source #

Run a Suave computation by spinning up its webpage at localhost:8080.

suavementely :: Map String SomeSuave -> IO () Source #

Run a Suave computation by spinning up its webpage at localhost:8080.

socketHandler :: Map String SomeSuave -> String -> Connection -> Handler () Source #

Handler endpoint for responding to Suave's websockets.

htmlHandler :: Map String SomeSuave -> String -> Handler Markup Source #

Serve the static HTML.