hyperbole-0.2.0: Web Framework inspired by HTMX
Safe HaskellSafe-Inferred
LanguageGHC2021

Web.Hyperbole.Effect

Synopsis

Documentation

data Request Source #

Constructors

Request 

Fields

Instances

Instances details
Show Request Source # 
Instance details

Defined in Web.Hyperbole.Effect

newtype Page es a Source #

Constructors

Page (Eff es a) 

Instances

Instances details
Applicative (Page es) Source # 
Instance details

Defined in Web.Hyperbole.Effect

Methods

pure :: a -> Page es a #

(<*>) :: Page es (a -> b) -> Page es a -> Page es b #

liftA2 :: (a -> b -> c) -> Page es a -> Page es b -> Page es c #

(*>) :: Page es a -> Page es b -> Page es b #

(<*) :: Page es a -> Page es b -> Page es a #

Functor (Page es) Source # 
Instance details

Defined in Web.Hyperbole.Effect

Methods

fmap :: (a -> b) -> Page es a -> Page es b #

(<$) :: a -> Page es b -> Page es a #

Monad (Page es) Source # 
Instance details

Defined in Web.Hyperbole.Effect

Methods

(>>=) :: Page es a -> (a -> Page es b) -> Page es b #

(>>) :: Page es a -> Page es b -> Page es b #

return :: a -> Page es a #

data Event act id Source #

Constructors

Event 

Fields

data Hyperbole :: Effect where Source #

Constructors

GetForm :: Hyperbole m Form 
GetEvent :: HyperView id => Hyperbole m (Maybe (Event (Action id) id)) 
Respond :: Response -> Hyperbole m a 

Instances

Instances details
type DispatchOf Hyperbole Source # 
Instance details

Defined in Web.Hyperbole.Effect

runHyperboleRoute :: Route route => Request -> (route -> Eff (Hyperbole : es) ()) -> Eff es Response Source #

view :: Hyperbole :> es => View () () -> Eff es () Source #

Set the response to the view. Note that page already expects a view to be returned from the effect

load :: Hyperbole :> es => Eff es (View () ()) -> Page es () Source #

Load the entire page when no HyperViews match

hyper :: (Hyperbole :> es, HyperView id) => (id -> Action id -> Eff es (View id ())) -> Page es () Source #

Handle a HyperView. If the event matches our handler, respond with the fragment

page :: Hyperbole :> es => Page es () -> Eff es () Source #