Shpadoinkle-0.3.0.0: A programming model for declarative, high performance user interface.

Safe HaskellNone
LanguageHaskell2010

Shpadoinkle.Run

Contents

Synopsis

Agnostic Run

runJSorWarp :: Int -> JSM () -> IO () Source #

Start the program!

This function works in GHC and GHCjs. I saved you from using C preprocessor directly. You're welcome.

Live Reloads

data Env Source #

Constructors

Dev 
Prod 

type Port = Int Source #

liveWithBackend :: Port -> JSM () -> IO Application -> IO () Source #

live :: Port -> JSM () -> IO () Source #

Convenience Variants

fullPage Source #

Arguments

:: Backend b m a 
=> Monad (b m) 
=> Eq a 
=> (m ~> JSM)

How do we get to JSM?

-> (TVar a -> b m ~> m)

What backend are we running?

-> a

What is the initial state?

-> (a -> Html (b m) a)

How should the html look?

-> b m RawNode

Where do we render?

-> JSM () 

Wrapper around shpadoinkle for full page apps that do not need outside control of the territory

fullPageJSM Source #

Arguments

:: Backend b JSM a 
=> Monad (b JSM) 
=> Eq a 
=> (TVar a -> b JSM ~> JSM)

What backend are we running?

-> a

What is the initial state?

-> (a -> Html (b JSM) a)

How should the html look?

-> b JSM RawNode

Where do we render?

-> JSM () 

fullPageJSM is a wrapper around shpadoinkle for full page apps that do not need outside control of the territory, where actions are performed directly in JSM.

This set of assumptions is extremely common when starting a new project.

simple Source #

Arguments

:: Backend b JSM a 
=> Monad (b JSM) 
=> Eq a 
=> (TVar a -> b JSM ~> JSM)

What backend are we running?

-> a

what is the initial state?

-> (a -> Html (b JSM) a)

how should the html look?

-> b JSM RawNode

where do we render?

-> JSM () 

Simple app

(a good starting place)