Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- respondEarly :: forall (es :: [Effect]) id. (Hyperbole :> es, HyperView id es) => id -> View id () -> Eff es ()
- notFound :: forall (es :: [Effect]) a. Hyperbole :> es => Eff es a
- parseError :: forall (es :: [Effect]) a. Hyperbole :> es => Text -> Eff es a
- redirect :: forall (es :: [Effect]) a. Hyperbole :> es => Url -> Eff es a
- view :: forall (es :: [Effect]). Hyperbole :> es => View () () -> Eff es Response
Documentation
respondEarly :: forall (es :: [Effect]) id. (Hyperbole :> es, HyperView id es) => id -> View id () -> Eff es () Source #
Respond with the given view, and stop execution
notFound :: forall (es :: [Effect]) a. Hyperbole :> es => Eff es a Source #
Respond immediately with 404 Not Found
userLoad :: (Hyperbole :> es, Users :> es) => UserId -> Eff es User userLoad uid = do mu <- send (LoadUser uid) maybe notFound pure mu myPage :: (Hyperbole :> es, Users :> es) => Eff es View myPage = do load $ do u <- userLoad 100 -- skipped if user = Nothing pure $ userView u
parseError :: forall (es :: [Effect]) a. Hyperbole :> es => Text -> Eff es a Source #
Respond immediately with a parse error