Shpadoinkle-backend-pardiff-0.0.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 cannonical 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 cannonical, 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.

Documentation

newtype ParDiffT s model m a Source #

Constructors

ParDiffT 

Fields

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

ask :: ParDiffT s model m (s model) #

local :: (s model -> s model) -> ParDiffT s model m a -> ParDiffT s model m a #

reader :: (s model -> a) -> ParDiffT s model m a #

MonadTrans (ParDiffT s model) Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

Methods

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

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

Defined in Shpadoinkle.Backend.ParDiff

Associated Types

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

Methods

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

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

setup :: JSM () -> ParDiffT t a m () #

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

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

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

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

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

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

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

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

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

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

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

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

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

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

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

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

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

empty :: ParDiffT s model m a #

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

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

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

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

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

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

Defined in Shpadoinkle.Backend.ParDiff

Methods

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

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

type VNode (ParDiffT t a) m Source # 
Instance details

Defined in Shpadoinkle.Backend.ParDiff

type VNode (ParDiffT t a) m

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

stage :: FromJSVal b => MonadJSM m => ParDiffT s a m b Source #