Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- bridgePage :: Page
- sendc :: Engine -> Text -> IO ()
- append :: Engine -> Text -> Text -> IO ()
- replace :: Engine -> Text -> Text -> IO ()
- appendWithScript :: Engine -> Text -> Text -> IO ()
- replaceWithScript :: Engine -> Text -> Text -> IO ()
- bridge :: Engine -> Cont_ IO Value
- sendConcerns :: Engine -> Text -> Concerns Text -> IO ()
- data Engine
- start :: (Engine -> IO ()) -> Application -> Application
- type Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived
- midShared :: Show a => SharedRep IO a -> (Engine -> Rep a -> StateT (HashMap Text Text) IO ()) -> (Engine -> Either Text (HashMap Text Text, Either Text a) -> IO ()) -> Application -> Application
Documentation
bridgePage :: Page Source #
start :: (Engine -> IO ()) -> Application -> Application #
This accepts WebSocket requests, calls the callback with
an Engine
that can be used to access JavaScript.
type Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived #
The WAI application.
Note that, since WAI 3.0, this type is structured in continuation passing
style to allow for proper safe resource handling. This was handled in the
past via other means (e.g., ResourceT
). As a demonstration:
app :: Application app req respond = bracket_ (putStrLn "Allocating scarce resource") (putStrLn "Cleaning up") (respond $ responseLBS status200 [] "Hello World")