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

Shpadoinkle.Run

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 Source #

Arguments

:: Port

Port to server the live server

-> JSM ()

Frontend application

-> IO Application

Server API

-> IO () 

Serve a web server and a jsaddle warp frontend at the same time. This is useful for live reloads for development purposes. For example: ghcid -c "cabal repl dev" -W -T "Main.main"

liveWithStatic Source #

Arguments

:: Port

Port to serve the live server

-> JSM ()

Frontend application

-> FilePath

Path to static files

-> IO () 

Serve jsaddle warp frontend with a static file server.

live Source #

Arguments

:: Port

Port to server the live server

-> JSM ()

Frontend application

-> IO () 

Serve jsaddle warp frontend. This is useful for live reloads for development purposes. For example: ghcid -c "cabal repl" -W -T "Main.dev"

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)