Shpadoinkle-backend-pardiff-0.3.0.1: A Virtual Dom in pure Haskell, based on Html as an Alignable Functor.

Safe HaskellNone
LanguageHaskell2010

Shpadoinkle.Backend.ParDiff

Description

This backend is to serve as a canonical representation of a well-behaved backend. Defining well-behaved in the context of web development is rather difficult and complex.

The rules of a backend are informal. Roughly, if we give the backend some Html, we expect it to update the DOM at runtime in the way we expect.

Since this is canonical, all other backends are expected to behave identically to this one. If differences exist they should be patched so that we retain renderer polymorphism, such that we can change out the renderer of our application; without updating the application logic with confidence it will behave as expected.

Synopsis

Documentation

newtype ParDiffT model m a Source #

Constructors

ParDiffT 

Fields

Instances
MonadRWS r w s m => MonadRWS r w s (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

MonadReader r m => MonadReader r (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

ask :: ParDiffT model m r Source #

local :: (r -> r) -> ParDiffT model m a -> ParDiffT model m a Source #

reader :: (r -> a) -> ParDiffT model m a Source #

MonadState s m => MonadState s (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

get :: ParDiffT model m s Source #

put :: s -> ParDiffT model m () Source #

state :: (s -> (a, s)) -> ParDiffT model m a Source #

MonadError e m => MonadError e (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

throwError :: e -> ParDiffT model m a Source #

catchError :: ParDiffT model m a -> (e -> ParDiffT model m a) -> ParDiffT model m a Source #

MonadWriter w m => MonadWriter w (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

writer :: (a, w) -> ParDiffT model m a Source #

tell :: w -> ParDiffT model m () Source #

listen :: ParDiffT model m a -> ParDiffT model m (a, w) Source #

pass :: ParDiffT model m (a, w -> w) -> ParDiffT model m a Source #

MonadBase n m => MonadBase n (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

liftBase :: n α -> ParDiffT model m α Source #

MonadBaseControl n m => MonadBaseControl n (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Associated Types

type StM (ParDiffT model m) a :: Type Source #

Methods

liftBaseWith :: (RunInBase (ParDiffT model m) n -> n a) -> ParDiffT model m a Source #

restoreM :: StM (ParDiffT model m) a -> ParDiffT model m a Source #

MonadTrans (ParDiffT model) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

lift :: Monad m => m a -> ParDiffT model m a Source #

MonadTransControl (ParDiffT model) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Associated Types

type StT (ParDiffT model) a :: Type Source #

Methods

liftWith :: Monad m => (Run (ParDiffT model) -> m a) -> ParDiffT model m a Source #

restoreT :: Monad m => m (StT (ParDiffT model) a) -> ParDiffT model m a Source #

(MonadUnliftIO m, MonadJSM m, NFData a, Show a) => Backend (ParDiffT a) m a Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Associated Types

type VNode (ParDiffT a) m :: Type Source #

Methods

interpret :: (m ~> JSM) -> Html (ParDiffT a m) a -> ParDiffT a m (VNode (ParDiffT a) m) Source #

patch :: RawNode -> Maybe (VNode (ParDiffT a) m) -> VNode (ParDiffT a) m -> ParDiffT a m (VNode (ParDiffT a) m) Source #

setup :: JSM () -> JSM () Source #

Monad m => Monad (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

(>>=) :: ParDiffT model m a -> (a -> ParDiffT model m b) -> ParDiffT model m b Source #

(>>) :: ParDiffT model m a -> ParDiffT model m b -> ParDiffT model m b Source #

return :: a -> ParDiffT model m a Source #

fail :: String -> ParDiffT model m a Source #

Functor m => Functor (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

fmap :: (a -> b) -> ParDiffT model m a -> ParDiffT model m b Source #

(<$) :: a -> ParDiffT model m b -> ParDiffT model m a Source #

Applicative m => Applicative (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

pure :: a -> ParDiffT model m a Source #

(<*>) :: ParDiffT model m (a -> b) -> ParDiffT model m a -> ParDiffT model m b Source #

liftA2 :: (a -> b -> c) -> ParDiffT model m a -> ParDiffT model m b -> ParDiffT model m c Source #

(*>) :: ParDiffT model m a -> ParDiffT model m b -> ParDiffT model m b Source #

(<*) :: ParDiffT model m a -> ParDiffT model m b -> ParDiffT model m a Source #

MonadUnliftIO m => MonadUnliftIO (ParDiffT r m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

askUnliftIO :: ParDiffT r m (UnliftIO (ParDiffT r m)) Source #

withRunInIO :: ((forall a. ParDiffT r m a -> IO a) -> IO b) -> ParDiffT r m b Source #

MonadJSM m => MonadJSM (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

liftJSM' :: JSM a -> ParDiffT model m a Source #

Alternative m => Alternative (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

empty :: ParDiffT model m a Source #

(<|>) :: ParDiffT model m a -> ParDiffT model m a -> ParDiffT model m a Source #

some :: ParDiffT model m a -> ParDiffT model m [a] Source #

many :: ParDiffT model m a -> ParDiffT model m [a] Source #

MonadIO m => MonadIO (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

liftIO :: IO a -> ParDiffT model m a Source #

MonadThrow m => MonadThrow (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

throwM :: Exception e => e -> ParDiffT model m a Source #

MonadCatch m => MonadCatch (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

catch :: Exception e => ParDiffT model m a -> (e -> ParDiffT model m a) -> ParDiffT model m a Source #

MonadMask m => MonadMask (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

mask :: ((forall a. ParDiffT model m a -> ParDiffT model m a) -> ParDiffT model m b) -> ParDiffT model m b Source #

uninterruptibleMask :: ((forall a. ParDiffT model m a -> ParDiffT model m a) -> ParDiffT model m b) -> ParDiffT model m b Source #

generalBracket :: ParDiffT model m a -> (a -> ExitCase b -> ParDiffT model m c) -> (a -> ParDiffT model m b) -> ParDiffT model m (b, c) Source #

MonadCont m => MonadCont (ParDiffT model m) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

callCC :: ((a -> ParDiffT model m b) -> ParDiffT model m a) -> ParDiffT model m a Source #

type VNode (ParDiffT a) m Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

type VNode (ParDiffT a) m
type StT (ParDiffT model) a Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

type StT (ParDiffT model) a = StT (ReaderT (TVar model)) a
type StM (ParDiffT model m) a Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

type StM (ParDiffT model m) a = ComposeSt (ParDiffT model) m a

runParDiff :: TVar model -> ParDiffT model m ~> m Source #

ParDiffT is a newtype of ReaderT, this is the runReaderT equivalent.

stage :: MonadJSM m => ParDiffT a m RawNode Source #

Get the body DOM node after emptying it.