Module

Halogen.HTML

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

#ComponentHTML

type ComponentHTML action slots m = HTML (ComponentSlot 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

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

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

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

#slot

slot :: forall query action input output slots m label slot _1. Cons label (Slot query output slot) _1 slots => IsSymbol label => Ord slot => Proxy label -> slot -> Component query input output m -> input -> (output -> 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

#slot_

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

Defines a slot for a child component, ignoring its output.

This variant may be used when the component produces output, but it is not needed in the current context, or instead of passing absurd to slot when the output type is Void.

Takes:

  • the slot address label
  • the slot address index
  • the component for the slot
  • the input value to pass to the component

#memoized

memoized :: forall a action slots m. (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

lazy :: forall a action slots m. (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

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

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

#lazy3

lazy3 :: forall a b c action slots m. (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

newtype PropName value

Constructors

Instances

#Namespace

#HTML

newtype HTML w i

Constructors

Instances

#ElemName

#ClassName

newtype ClassName

A wrapper for strings which are used as CSS classes.

Constructors

Instances

#AttrName

newtype AttrName

A wrapper for attribute names.

Constructors

Instances

#text

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

Constructs a text node HTML value.

#handler

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

Create an event handler.

Re-exports from Halogen.HTML.Elements

#Node

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

An HTML element that admits children.

#Leaf

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

An HTML element that does not admit children.

#withKeys_

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

#withKeys

withKeys :: forall r w i. (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

wbr :: forall w i. Leaf HTMLwbr w i

#video_

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

#video

video :: forall w i. Node HTMLvideo w i

#var_

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

#var

var :: forall w i. Node HTMLvar w i

#ul_

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

#ul

ul :: forall w i. Node HTMLul w i

#u_

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

#u

u :: forall w i. Node HTMLu w i

#track

track :: forall w i. Leaf HTMLtrack w i

#tr_

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

#tr

tr :: forall w i. Node HTMLtr w i

#title_

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

#title

title :: forall w i. Node HTMLtitle w i

#time_

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

#time

time :: forall w i. Node HTMLtime w i

#thead_

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

#thead

thead :: forall w i. Node HTMLthead w i

#th_

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

#th

th :: forall w i. Node HTMLth w i

#tfoot_

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

#tfoot

tfoot :: forall w i. Node HTMLtfoot w i

#textarea

textarea :: forall w i. Leaf HTMLtextarea w i

#td_

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

#td

td :: forall w i. Node HTMLtd w i

#tbody_

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

#tbody

tbody :: forall w i. Node HTMLtbody w i

#table_

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

#table

table :: forall w i. Node HTMLtable w i

#sup_

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

#sup

sup :: forall w i. Node HTMLsup w i

#summary_

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

#summary

summary :: forall w i. Node HTMLsummary w i

#sub_

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

#sub

sub :: forall w i. Node HTMLsub w i

#style_

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

#style

style :: forall w i. Node HTMLstyle w i

#strong_

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

#strong

strong :: forall w i. Node HTMLstrong w i

#span_

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

#span

span :: forall w i. Node HTMLspan w i

#source

source :: forall w i. Leaf HTMLsource w i

#small_

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

#small

small :: forall w i. Node HTMLsmall w i

#select_

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

#select

select :: forall w i. Node HTMLselect w i

#section_

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

#section

section :: forall w i. Node HTMLsection w i

#script_

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

#script

script :: forall w i. Node HTMLscript w i

#samp_

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

#samp

samp :: forall w i. Node HTMLsamp w i

#ruby_

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

#ruby

ruby :: forall w i. Node HTMLruby w i

#rt_

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

#rt

rt :: forall w i. Node HTMLrt w i

#rp_

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

#rp

rp :: forall w i. Node HTMLrp w i

#q_

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

#q

q :: forall w i. Node HTMLq w i

#progress_

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

#progress

progress :: forall w i. Node HTMLprogress w i

#pre_

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

#pre

pre :: forall w i. Node HTMLpre w i

#param

param :: forall w i. Leaf HTMLparam w i

#p_

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

#p

p :: forall w i. Node HTMLp w i

#output_

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

#output

output :: forall w i. Node HTMLoutput w i

#option_

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

#option

option :: forall w i. Node HTMLoption w i

#optgroup_

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

#optgroup

optgroup :: forall w i. Node HTMLoptgroup w i

#ol_

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

#ol

ol :: forall w i. Node HTMLol w i

#object_

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

#object

object :: forall w i. Node HTMLobject w i

#noscript_

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

#noscript

noscript :: forall w i. Node HTMLnoscript w i

#nav_

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

#nav

nav :: forall w i. Node HTMLnav w i

#meter_

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

#meter

meter :: forall w i. Node HTMLmeter w i

#meta

meta :: forall w i. Leaf HTMLmeta w i

#menuitem_

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

#menuitem

menuitem :: forall w i. Node HTMLmenuitem w i

#menu_

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

#menu

menu :: forall w i. Node HTMLmenu w i

#mark_

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

#mark

mark :: forall w i. Node HTMLmark w i

#map_

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

#map

map :: forall w i. Node HTMLmap w i

#main_

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

#main

main :: forall w i. Node HTMLmain w i

#li_

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

#li

li :: forall w i. Node HTMLli w i

#legend_

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

#legend

legend :: forall w i. Node HTMLlegend w i

#label_

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

#label

label :: forall w i. Node HTMLlabel w i

#keyedNS

keyedNS :: forall r w i. 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

keyed :: forall r w i. 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_

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

#kbd

kbd :: forall w i. Node HTMLkbd w i

#ins_

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

#ins

ins :: forall w i. Node HTMLins w i

#input

input :: forall w i. Leaf HTMLinput w i

#img

img :: forall w i. Leaf HTMLimg w i

#iframe

iframe :: forall w i. Leaf HTMLiframe w i

#i_

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

#i

i :: forall w i. Node HTMLi w i

#html_

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

#html

html :: forall w i. Node HTMLhtml w i

#hr_

hr_ :: forall w i. HTML w i

#hr

hr :: forall w i. Leaf HTMLhr w i

#header_

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

#header

header :: forall w i. Node HTMLheader w i

#head_

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

#head

head :: forall w i. Node HTMLhead w i

#h6_

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

#h6

h6 :: forall w i. Node HTMLh6 w i

#h5_

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

#h5

h5 :: forall w i. Node HTMLh5 w i

#h4_

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

#h4

h4 :: forall w i. Node HTMLh4 w i

#h3_

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

#h3

h3 :: forall w i. Node HTMLh3 w i

#h2_

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

#h2

h2 :: forall w i. Node HTMLh2 w i

#h1_

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

#h1

h1 :: forall w i. Node HTMLh1 w i

#form_

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

#form

form :: forall w i. Node HTMLform w i

#footer_

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

#footer

footer :: forall w i. Node HTMLfooter w i

#figure_

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

#figure

figure :: forall w i. Node HTMLfigure w i

#figcaption_

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

#figcaption

figcaption :: forall w i. Node HTMLfigcaption w i

#fieldset_

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

#fieldset

fieldset :: forall w i. Node HTMLfieldset w i

#embed_

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

#embed

embed :: forall w i. Node HTMLembed w i

#em_

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

#em

em :: forall w i. Node HTMLem w i

#elementNS

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

Creates a Namespaced HTML element that expects indexed properties.

#element

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

Creates an HTML element that expects indexed properties.

#dt_

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

#dt

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

#dl_

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

#dl

dl :: forall w i. Node HTMLdl w i

#div_

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

#div

div :: forall w i. Node HTMLdiv w i

#dialog_

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

#dialog

dialog :: forall w i. Node HTMLdialog w i

#dfn_

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

#dfn

dfn :: forall w i. Node HTMLdfn w i

#details_

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

#details

details :: forall w i. Node HTMLdetails w i

#del_

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

#del

del :: forall w i. Node HTMLdel w i

#dd_

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

#dd

dd :: forall w i. Node HTMLdd w i

#datalist_

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

#datalist

datalist :: forall w i. Node HTMLdatalist w i

#command

command :: forall w i. Leaf HTMLcommand w i

#colgroup_

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

#colgroup

colgroup :: forall w i. Node HTMLcolgroup w i

#col

col :: forall w i. Leaf HTMLcol w i

#code_

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

#code

code :: forall w i. Node HTMLcode w i

#cite_

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

#cite

cite :: forall w i. Node HTMLcite w i

#caption_

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

#caption

caption :: forall w i. Node HTMLcaption w i

#canvas

canvas :: forall w i. Leaf HTMLcanvas w i

#button_

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

#button

button :: forall w i. Node HTMLbutton w i

#br_

br_ :: forall w i. HTML w i

#br

br :: forall w i. Leaf HTMLbr w i

#body_

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

#body

body :: forall w i. Node HTMLbody w i

#blockquote_

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

#blockquote

blockquote :: forall w i. Node HTMLblockquote w i

#bdo_

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

#bdo

bdo :: forall w i. Node HTMLbdo w i

#bdi_

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

#bdi

bdi :: forall w i. Node HTMLbdi w i

#base

base :: forall w i. Leaf HTMLbase w i

#b_

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

#b

b :: forall w i. Node HTMLb w i

#audio_

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

#audio

audio :: forall w i. Node HTMLaudio w i

#aside_

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

#aside

aside :: forall w i. Node HTMLaside w i

#article_

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

#article

article :: forall w i. Node HTMLarticle w i

#area

area :: forall w i. Leaf HTMLarea w i

#address_

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

#address

address :: forall w i. Node HTMLaddress w i

#abbr_

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

#abbr

abbr :: forall w i. Node HTMLabbr w i

#a_

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

#a

a :: forall w i. Node HTMLa w i

Re-exports from Halogen.HTML.Properties

#IProp

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

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

Creates an indexed HTML property.

#attrNS

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

Creates an indexed HTML attribute.

#attr

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

Creates an indexed HTML attribute.

Modules