n2o-nitro-0.11.2: Nitro Elements, Events and Actions

Copyright(c) Marat Khafizov 2018
LicenseBSD-3
Maintainerxafizoff@gmail.com
Stabilityexperimental
Portabilitynot portable
Safe HaskellSafe
LanguageHaskell2010

Network.N2O.Nitro

Description

Nitro DSL to build interactive user interfaces

Synopsis

Documentation

data Element a Source #

An HTML element

Constructors

Element 
Text Text 
Instances
Show a => Show (Element a) Source # 
Instance details

Defined in Network.N2O.Nitro

Methods

showsPrec :: Int -> Element a -> ShowS #

show :: Element a -> String #

showList :: [Element a] -> ShowS #

Generic (Element a) Source # 
Instance details

Defined in Network.N2O.Nitro

Associated Types

type Rep (Element a) :: * -> * #

Methods

from :: Element a -> Rep (Element a) x #

to :: Rep (Element a) x -> Element a #

Binary a => Binary (Element a) Source # 
Instance details

Defined in Network.N2O.Nitro

Methods

put :: Element a -> Put #

get :: Get (Element a) #

putList :: [Element a] -> Put #

type Rep (Element a) Source # 
Instance details

Defined in Network.N2O.Nitro

data Action a Source #

Action that can be rendered as JavaScript events

Constructors

AEvent (Event a) 
AElement (Element a) 
ARaw ByteString 
Instances
Show a => Show (Action a) Source # 
Instance details

Defined in Network.N2O.Nitro

Methods

showsPrec :: Int -> Action a -> ShowS #

show :: Action a -> String #

showList :: [Action a] -> ShowS #

Generic (Action a) Source # 
Instance details

Defined in Network.N2O.Nitro

Associated Types

type Rep (Action a) :: * -> * #

Methods

from :: Action a -> Rep (Action a) x #

to :: Rep (Action a) x -> Action a #

Binary a => Binary (Action a) Source # 
Instance details

Defined in Network.N2O.Nitro

Methods

put :: Action a -> Put #

get :: Get (Action a) #

putList :: [Action a] -> Put #

type Rep (Action a) Source # 
Instance details

Defined in Network.N2O.Nitro

data Event a Source #

A JavaScript event

Instances
Show a => Show (Event a) Source # 
Instance details

Defined in Network.N2O.Nitro

Methods

showsPrec :: Int -> Event a -> ShowS #

show :: Event a -> String #

showList :: [Event a] -> ShowS #

Generic (Event a) Source # 
Instance details

Defined in Network.N2O.Nitro

Associated Types

type Rep (Event a) :: * -> * #

Methods

from :: Event a -> Rep (Event a) x #

to :: Rep (Event a) x -> Event a #

Binary a => Binary (Event a) Source # 
Instance details

Defined in Network.N2O.Nitro

Methods

put :: Event a -> Put #

get :: Get (Event a) #

putList :: [Event a] -> Put #

type Rep (Event a) Source # 
Instance details

Defined in Network.N2O.Nitro

wireEl :: Binary a => Element a -> N2O f a (Result a) Source #

Wire an element

wire :: forall f a. Binary a => Action a -> N2O f a (Result a) Source #

Wire action

renderActions :: Binary a => [Action a] -> N2O f a ByteString Source #

Render list of actions to JavaScript

renderAction :: Binary a => Action a -> N2O f a ByteString Source #

Render an action

renderElements :: Binary a => [Element a] -> N2O f a ByteString Source #

Render list of elements to the HTML

renderElement :: Binary a => Element a -> N2O f a ByteString Source #

Render element to the HTML

renderEvent :: Event a -> N2O f a ByteString Source #

Render event

baseElement :: Element a Source #

Element constructor

button :: Element a Source #

An HTML button

panel :: Element a Source #

A panel widget

text :: Text -> Element a Source #

Text node

br :: Element a Source #

br element

textbox :: Element a Source #

A textbox widget

updateText :: Binary a => ByteString -> Text -> N2O f a (Result a) Source #

Update text content of the element with the specified id

jsEscapeT :: Text -> Text Source #

Escape untrusted text to prevent XSS

jsEscape :: ByteString -> Text Source #

Escape untrusted text to prevent XSS

defPickle :: Show a => a -> ByteString Source #

Default pickler

defDePickle :: Read a => ByteString -> Maybe a Source #

Default depickler

getActions :: Binary a => N2O f a [Action a] Source #

Get action list from the local mutable state

putActions :: Binary a => [Action a] -> N2O f a () Source #

Put actions to the local mutable state