H.Component型
Halogen Componentのcomponentの型
4つの型引数を取る
内3つは、Halogenの親子の通信の仕方を表すもの
親からなにか受け取る場合は、queryやinputを指定する
親へなにかを送る場合は、outputを指定する
型
code:purs(hs)
data Component
(query :: Type -> Type)
(input :: Type)
(output :: Type)
(m :: Type -> Type)
4つの型引数を取る
query
is the query algebra; the requests that can be made of the component
親→子へのquery
Reactで言うと関数型のprops
onChange: (name: string) => void的な
指定しない場合は開いておく
https://purescript-halogen.github.io/purescript-halogen/guide/05-Parent-Child-Components.html#queries
tellとrequestの2種類ある
tell
親→子へ何かを実行するように命令する
request
親→子だが、子からの情報も必要とする
返り値を持っている 
code:purs(hs)
data Query a
= Tell a
| Request (Boolean -> a)
input
is the input value that will be received when the parent of this component renders
親から受けとる引数
reactでいうprops
親のstateが更新されるとinputも自動で更新される
静的propsなのか、動的propsなのかで、evalの指定が異なる
指定しない場合は開いておく
https://purescript-halogen.github.io/purescript-halogen/guide/05-Parent-Child-Components.html#communicating-among-components
output
is the type of messages the component can raise
HalogenのOutput
子→親へmessage送信
modalのclosing、formのsubmitなどのeventを通知
親が子をsubscriptionするために使う機構といった感じ
指定しない場合は開いておく
https://purescript-halogen.github.io/purescript-halogen/guide/05-Parent-Child-Components.html#output-messages
m
is the effect monad used during evaluation
EffectモナドかAffモナドを指定することが多い
指定しない場合は開いておく
handleActionのH.HalogenM型のmにmonad型制約をつけるなら、H.Componentのmにも同様に付けないといけない
子を持つ場合は、H.ComponentHTML型に対しても同様
逆は成り立たない
つまり、H.Comonentのmに制約をつけても、H.HalogenMのmに付けなくてもいい
2. Introducing Components - Halogen Guide
https://purescript-halogen.github.io/purescript-halogen/guide/05-Parent-Child-Components.html