Module

Halogen.HTML

Package
purescript-halogen
Repository
purescript-halogen/purescript-halogen

This module re-exports the types for the HTML DSL, and values for all supported HTML elements.

#ComponentHTML Source

type ComponentHTML action slots m = HTML (ComponentSlot HTML slots m action) action

A convenience synonym for the output type of a render function for a component that renders HTML.

  • action is the type of actions, events internal to the component that can be evaluated with the handleAction function
  • slots is the set of child component types that can be used in the HTML
  • m is the monad used by the child component during evaluation

#PlainHTML Source

type PlainHTML = HTML Void Void

A type useful for a chunk of HTML with no slot-embedding or query-raising.

Often a polymorphic usage of HTML is good enough for this, but sometimes it's useful to have a type like this (and accompanying coercion) when doing things like creating components that accept a chunk of HTML as part of their configuration.

#fromPlainHTML Source

fromPlainHTML :: forall i w. PlainHTML -> HTML w i

Relaxes the type of PlainHTML to make it compatible with all HTML.

#slot Source

slot :: forall _1 slot label m slots output input action query. Cons label (Slot query output slot) _1 slots => IsSymbol label => Ord slot => SProxy label -> slot -> Component HTML query input output m -> input -> (output -> Maybe action) -> ComponentHTML action slots m

Defines a slot for a child component. Takes:

  • the slot address label
  • the slot address index
  • the component for the slot
  • the input value to pass to the component
  • a function mapping outputs from the component to a query in the parent

#memoized Source

memoized :: forall m slots action a. (a -> a -> Boolean) -> (a -> ComponentHTML action slots m) -> a -> ComponentHTML action slots m

Optimizes rendering of a subtree given an equality predicate. If an argument is deemed equivalent to the previous value, rendering and diffing will be skipped. You should not use this function fully saturated, but instead partially apply it for use within a Component's scope. For example, to skip rendering for equal states, just wrap your render function.

myComponent = component
 { render: memoized eq render
 , ...
 }

#lazy Source

lazy :: forall m slots action a. (a -> ComponentHTML action slots m) -> a -> ComponentHTML action slots m

Skips rendering for referentially equal arguments. You should not use this function fully saturated, but instead partially apply it for use within a Component's scope.

#lazy2 Source

lazy2 :: forall m slots action b a. (a -> b -> ComponentHTML action slots m) -> a -> b -> ComponentHTML action slots m

Like lazy, but for a rendering function which takes 2 arguments.

#lazy3 Source

lazy3 :: forall m slots action c b a. (a -> b -> c -> ComponentHTML action slots m) -> a -> b -> c -> ComponentHTML action slots m

Like lazy, but for a rendering function which takes 3 arguments.

Re-exports from Halogen.HTML.Core

#PropName Source

newtype PropName value

A type-safe wrapper for property names.

The phantom type value describes the type of value which this property requires.

Constructors

Instances

#HTML Source

newtype HTML w i

Constructors

Instances

#ElemName Source

#ClassName Source

newtype ClassName

A wrapper for strings which are used as CSS classes.

Constructors

Instances

#AttrName Source

newtype AttrName

A type-safe wrapper for attribute names.

Constructors

Instances

#text Source

text :: forall i w. String -> HTML w i

Constructs a text node HTML value.

#handler Source

handler :: forall i. EventType -> (Event -> Maybe i) -> Prop i

Create an event handler.

Re-exports from Halogen.HTML.Elements

#Node Source

type Node r w i = Array (IProp r i) -> Array (HTML w i) -> HTML w i

An HTML element that admits children.

#Leaf Source

type Leaf r w i = Array (IProp r i) -> HTML w i

An HTML element that does not admit children.

#withKeys_ Source

withKeys_ :: forall i w. (Array (HTML w i) -> HTML w i) -> Array (Tuple String (HTML w i)) -> HTML w i

#withKeys Source

withKeys :: forall i w r. (Array (IProp r i) -> Array (HTML w i) -> HTML w i) -> Array (IProp r i) -> Array (Tuple String (HTML w i)) -> HTML w i

#wbr Source

wbr :: forall i w. Leaf HTMLwbr w i

#video_ Source

video_ :: forall i w. Array (HTML w i) -> HTML w i

#video Source

video :: forall i w. Node HTMLvideo w i

#var_ Source

var_ :: forall i w. Array (HTML w i) -> HTML w i

#var Source

var :: forall i w. Node HTMLvar w i

#ul_ Source

ul_ :: forall i w. Array (HTML w i) -> HTML w i

#ul Source

ul :: forall i w. Node HTMLul w i

#u_ Source

u_ :: forall i w. Array (HTML w i) -> HTML w i

#u Source

u :: forall i w. Node HTMLu w i

#track Source

track :: forall i w. Leaf HTMLtrack w i

#tr_ Source

tr_ :: forall i w. Array (HTML w i) -> HTML w i

#tr Source

tr :: forall i w. Node HTMLtr w i

#title_ Source

title_ :: forall i w. Array (HTML w i) -> HTML w i

#title Source

title :: forall i w. Node HTMLtitle w i

#time_ Source

time_ :: forall i w. Array (HTML w i) -> HTML w i

#time Source

time :: forall i w. Node HTMLtime w i

#thead_ Source

thead_ :: forall i w. Array (HTML w i) -> HTML w i

#thead Source

thead :: forall i w. Node HTMLthead w i

#th_ Source

th_ :: forall i w. Array (HTML w i) -> HTML w i

#th Source

th :: forall i w. Node HTMLth w i

#tfoot_ Source

tfoot_ :: forall i w. Array (HTML w i) -> HTML w i

#tfoot Source

tfoot :: forall i w. Node HTMLtfoot w i

#textarea Source

textarea :: forall i w. Leaf HTMLtextarea w i

#td_ Source

td_ :: forall i w. Array (HTML w i) -> HTML w i

#td Source

td :: forall i w. Node HTMLtd w i

#tbody_ Source

tbody_ :: forall i w. Array (HTML w i) -> HTML w i

#tbody Source

tbody :: forall i w. Node HTMLtbody w i

#table_ Source

table_ :: forall i w. Array (HTML w i) -> HTML w i

#table Source

table :: forall i w. Node HTMLtable w i

#sup_ Source

sup_ :: forall i w. Array (HTML w i) -> HTML w i

#sup Source

sup :: forall i w. Node HTMLsup w i

#summary_ Source

summary_ :: forall i w. Array (HTML w i) -> HTML w i

#summary Source

summary :: forall i w. Node HTMLsummary w i

#sub_ Source

sub_ :: forall i w. Array (HTML w i) -> HTML w i

#sub Source

sub :: forall i w. Node HTMLsub w i

#style_ Source

style_ :: forall i w. Array (HTML w i) -> HTML w i

#style Source

style :: forall i w. Node HTMLstyle w i

#strong_ Source

strong_ :: forall i w. Array (HTML w i) -> HTML w i

#strong Source

strong :: forall i w. Node HTMLstrong w i

#span_ Source

span_ :: forall i w. Array (HTML w i) -> HTML w i

#span Source

span :: forall i w. Node HTMLspan w i

#source Source

source :: forall i w. Leaf HTMLsource w i

#small_ Source

small_ :: forall i w. Array (HTML w i) -> HTML w i

#small Source

small :: forall i w. Node HTMLsmall w i

#select_ Source

select_ :: forall i w. Array (HTML w i) -> HTML w i

#select Source

select :: forall i w. Node HTMLselect w i

#section_ Source

section_ :: forall i w. Array (HTML w i) -> HTML w i

#section Source

section :: forall i w. Node HTMLsection w i

#script_ Source

script_ :: forall i w. Array (HTML w i) -> HTML w i

#script Source

script :: forall i w. Node HTMLscript w i

#samp_ Source

samp_ :: forall i w. Array (HTML w i) -> HTML w i

#samp Source

samp :: forall i w. Node HTMLsamp w i

#ruby_ Source

ruby_ :: forall i w. Array (HTML w i) -> HTML w i

#ruby Source

ruby :: forall i w. Node HTMLruby w i

#rt_ Source

rt_ :: forall i w. Array (HTML w i) -> HTML w i

#rt Source

rt :: forall i w. Node HTMLrt w i

#rp_ Source

rp_ :: forall i w. Array (HTML w i) -> HTML w i

#rp Source

rp :: forall i w. Node HTMLrp w i

#q_ Source

q_ :: forall i w. Array (HTML w i) -> HTML w i

#q Source

q :: forall i w. Node HTMLq w i

#progress_ Source

progress_ :: forall i w. Array (HTML w i) -> HTML w i

#progress Source

progress :: forall i w. Node HTMLprogress w i

#pre_ Source

pre_ :: forall i w. Array (HTML w i) -> HTML w i

#pre Source

pre :: forall i w. Node HTMLpre w i

#param Source

param :: forall i w. Leaf HTMLparam w i

#p_ Source

p_ :: forall i w. Array (HTML w i) -> HTML w i

#p Source

p :: forall i w. Node HTMLp w i

#output_ Source

output_ :: forall i w. Array (HTML w i) -> HTML w i

#output Source

output :: forall i w. Node HTMLoutput w i

#option_ Source

option_ :: forall i w. Array (HTML w i) -> HTML w i

#option Source

option :: forall i w. Node HTMLoption w i

#optgroup_ Source

optgroup_ :: forall i w. Array (HTML w i) -> HTML w i

#optgroup Source

optgroup :: forall i w. Node HTMLoptgroup w i

#ol_ Source

ol_ :: forall i w. Array (HTML w i) -> HTML w i

#ol Source

ol :: forall i w. Node HTMLol w i

#object_ Source

object_ :: forall i w. Array (HTML w i) -> HTML w i

#object Source

object :: forall i w. Node HTMLobject w i

#noscript_ Source

noscript_ :: forall i w. Array (HTML w i) -> HTML w i

#noscript Source

noscript :: forall i w. Node HTMLnoscript w i

#nav_ Source

nav_ :: forall i w. Array (HTML w i) -> HTML w i

#nav Source

nav :: forall i w. Node HTMLnav w i

#meter_ Source

meter_ :: forall i w. Array (HTML w i) -> HTML w i

#meter Source

meter :: forall i w. Node HTMLmeter w i

#meta Source

meta :: forall i w. Leaf HTMLmeta w i

#menuitem_ Source

menuitem_ :: forall i w. Array (HTML w i) -> HTML w i

#menuitem Source

menuitem :: forall i w. Node HTMLmenuitem w i

#menu_ Source

menu_ :: forall i w. Array (HTML w i) -> HTML w i

#menu Source

menu :: forall i w. Node HTMLmenu w i

#mark_ Source

mark_ :: forall i w. Array (HTML w i) -> HTML w i

#mark Source

mark :: forall i w. Node HTMLmark w i

#map_ Source

map_ :: forall i w. Array (HTML w i) -> HTML w i

#map Source

map :: forall i w. Node HTMLmap w i

#main_ Source

main_ :: forall i w. Array (HTML w i) -> HTML w i

#main Source

main :: forall i w. Node HTMLmain w i

#li_ Source

li_ :: forall i w. Array (HTML w i) -> HTML w i

#li Source

li :: forall i w. Node HTMLli w i

#legend_ Source

legend_ :: forall i w. Array (HTML w i) -> HTML w i

#legend Source

legend :: forall i w. Node HTMLlegend w i

#label_ Source

label_ :: forall i w. Array (HTML w i) -> HTML w i

#label Source

label :: forall i w. Node HTMLlabel w i

#keyedNS Source

keyedNS :: forall i w r. Namespace -> ElemName -> Array (IProp r i) -> Array (Tuple String (HTML w i)) -> HTML w i

Creates a Namespaced HTML element that expects indexed properties, with keyed children.

#keyed Source

keyed :: forall i w r. ElemName -> Array (IProp r i) -> Array (Tuple String (HTML w i)) -> HTML w i

Creates an HTML element that expects indexed properties, with keyed children.

#kbd_ Source

kbd_ :: forall i w. Array (HTML w i) -> HTML w i

#kbd Source

kbd :: forall i w. Node HTMLkbd w i

#ins_ Source

ins_ :: forall i w. Array (HTML w i) -> HTML w i

#ins Source

ins :: forall i w. Node HTMLins w i

#input Source

input :: forall i w. Leaf HTMLinput w i

#img Source

img :: forall i w. Leaf HTMLimg w i

#iframe Source

iframe :: forall i w. Leaf HTMLiframe w i

#i_ Source

i_ :: forall i w. Array (HTML w i) -> HTML w i

#i Source

i :: forall i w. Node HTMLi w i

#html_ Source

html_ :: forall i w. Array (HTML w i) -> HTML w i

#html Source

html :: forall i w. Node HTMLhtml w i

#hr_ Source

hr_ :: forall i w. HTML w i

#hr Source

hr :: forall i w. Leaf HTMLhr w i

#header_ Source

header_ :: forall i w. Array (HTML w i) -> HTML w i

#header Source

header :: forall i w. Node HTMLheader w i

#head_ Source

head_ :: forall i w. Array (HTML w i) -> HTML w i

#head Source

head :: forall i w. Node HTMLhead w i

#h6_ Source

h6_ :: forall i w. Array (HTML w i) -> HTML w i

#h6 Source

h6 :: forall i w. Node HTMLh6 w i

#h5_ Source

h5_ :: forall i w. Array (HTML w i) -> HTML w i

#h5 Source

h5 :: forall i w. Node HTMLh5 w i

#h4_ Source

h4_ :: forall i w. Array (HTML w i) -> HTML w i

#h4 Source

h4 :: forall i w. Node HTMLh4 w i

#h3_ Source

h3_ :: forall i w. Array (HTML w i) -> HTML w i

#h3 Source

h3 :: forall i w. Node HTMLh3 w i

#h2_ Source

h2_ :: forall i w. Array (HTML w i) -> HTML w i

#h2 Source

h2 :: forall i w. Node HTMLh2 w i

#h1_ Source

h1_ :: forall i w. Array (HTML w i) -> HTML w i

#h1 Source

h1 :: forall i w. Node HTMLh1 w i

#form_ Source

form_ :: forall i w. Array (HTML w i) -> HTML w i

#form Source

form :: forall i w. Node HTMLform w i

#footer_ Source

footer_ :: forall i w. Array (HTML w i) -> HTML w i

#footer Source

footer :: forall i w. Node HTMLfooter w i

#figure_ Source

figure_ :: forall i w. Array (HTML w i) -> HTML w i

#figure Source

figure :: forall i w. Node HTMLfigure w i

#figcaption_ Source

figcaption_ :: forall i w. Array (HTML w i) -> HTML w i

#figcaption Source

figcaption :: forall i w. Node HTMLfigcaption w i

#fieldset_ Source

fieldset_ :: forall i w. Array (HTML w i) -> HTML w i

#fieldset Source

fieldset :: forall i w. Node HTMLfieldset w i

#embed_ Source

embed_ :: forall i w. Array (HTML w i) -> HTML w i

#embed Source

embed :: forall i w. Node HTMLembed w i

#em_ Source

em_ :: forall i w. Array (HTML w i) -> HTML w i

#em Source

em :: forall i w. Node HTMLem w i

#elementNS Source

elementNS :: forall i w r. Namespace -> ElemName -> Array (IProp r i) -> Array (HTML w i) -> HTML w i

Creates a Namespaced HTML element that expects indexed properties.

#element Source

element :: forall i w r. ElemName -> Array (IProp r i) -> Array (HTML w i) -> HTML w i

Creates an HTML element that expects indexed properties.

#dt_ Source

dt_ :: forall i w. Array (HTML w i) -> HTML w i

#dt Source

dt :: forall i w. Node (HTMLdt) w i

#dl_ Source

dl_ :: forall i w. Array (HTML w i) -> HTML w i

#dl Source

dl :: forall i w. Node HTMLdl w i

#div_ Source

div_ :: forall i w. Array (HTML w i) -> HTML w i

#div Source

div :: forall i w. Node HTMLdiv w i

#dialog_ Source

dialog_ :: forall i w. Array (HTML w i) -> HTML w i

#dialog Source

dialog :: forall i w. Node HTMLdialog w i

#dfn_ Source

dfn_ :: forall i w. Array (HTML w i) -> HTML w i

#dfn Source

dfn :: forall i w. Node HTMLdfn w i

#details_ Source

details_ :: forall i w. Array (HTML w i) -> HTML w i

#details Source

details :: forall i w. Node HTMLdetails w i

#del_ Source

del_ :: forall i w. Array (HTML w i) -> HTML w i

#del Source

del :: forall i w. Node HTMLdel w i

#dd_ Source

dd_ :: forall i w. Array (HTML w i) -> HTML w i

#dd Source

dd :: forall i w. Node HTMLdd w i

#datalist_ Source

datalist_ :: forall i w. Array (HTML w i) -> HTML w i

#datalist Source

datalist :: forall i w. Node HTMLdatalist w i

#command Source

command :: forall i w. Leaf HTMLcommand w i

#colgroup_ Source

colgroup_ :: forall i w. Array (HTML w i) -> HTML w i

#colgroup Source

colgroup :: forall i w. Node HTMLcolgroup w i

#col Source

col :: forall i w. Leaf HTMLcol w i

#code_ Source

code_ :: forall i w. Array (HTML w i) -> HTML w i

#code Source

code :: forall i w. Node HTMLcode w i

#cite_ Source

cite_ :: forall i w. Array (HTML w i) -> HTML w i

#cite Source

cite :: forall i w. Node HTMLcite w i

#caption_ Source

caption_ :: forall i w. Array (HTML w i) -> HTML w i

#caption Source

caption :: forall i w. Node HTMLcaption w i

#canvas Source

canvas :: forall i w. Leaf HTMLcanvas w i

#button_ Source

button_ :: forall i w. Array (HTML w i) -> HTML w i

#button Source

button :: forall i w. Node HTMLbutton w i

#br_ Source

br_ :: forall i w. HTML w i

#br Source

br :: forall i w. Leaf HTMLbr w i

#body_ Source

body_ :: forall i w. Array (HTML w i) -> HTML w i

#body Source

body :: forall i w. Node HTMLbody w i

#blockquote_ Source

blockquote_ :: forall i w. Array (HTML w i) -> HTML w i

#blockquote Source

blockquote :: forall i w. Node HTMLblockquote w i

#bdo_ Source

bdo_ :: forall i w. Array (HTML w i) -> HTML w i

#bdo Source

bdo :: forall i w. Node HTMLbdo w i

#bdi_ Source

bdi_ :: forall i w. Array (HTML w i) -> HTML w i

#bdi Source

bdi :: forall i w. Node HTMLbdi w i

#base Source

base :: forall i w. Leaf HTMLbase w i

#b_ Source

b_ :: forall i w. Array (HTML w i) -> HTML w i

#b Source

b :: forall i w. Node HTMLb w i

#audio_ Source

audio_ :: forall i w. Array (HTML w i) -> HTML w i

#audio Source

audio :: forall i w. Node HTMLaudio w i

#aside_ Source

aside_ :: forall i w. Array (HTML w i) -> HTML w i

#aside Source

aside :: forall i w. Node HTMLaside w i

#article_ Source

article_ :: forall i w. Array (HTML w i) -> HTML w i

#article Source

article :: forall i w. Node HTMLarticle w i

#area Source

area :: forall i w. Leaf HTMLarea w i

#address_ Source

address_ :: forall i w. Array (HTML w i) -> HTML w i

#address Source

address :: forall i w. Node HTMLaddress w i

#abbr_ Source

abbr_ :: forall i w. Array (HTML w i) -> HTML w i

#abbr Source

abbr :: forall i w. Node HTMLabbr w i

#a_ Source

a_ :: forall i w. Array (HTML w i) -> HTML w i

#a Source

a :: forall i w. Node HTMLa w i

Re-exports from Halogen.HTML.Properties

#IProp Source

newtype IProp (r :: Row Type) i

The phantom row r can be thought of as a context which is synthesized in the course of constructing a refined HTML expression.

Instances

#prop Source

prop :: forall i r value. IsProp value => PropName value -> value -> IProp r i

Creates an indexed HTML property.

#attrNS Source

attrNS :: forall i r. Namespace -> AttrName -> String -> IProp r i

Creates an indexed HTML attribute.

#attr Source

attr :: forall i r. AttrName -> String -> IProp r i

Creates an indexed HTML attribute.