Description
From Q&A in Slack:
"""
Brandon Barker [4:04 PM]
Maybe this is more of an XML/DOM question, but looking at documentElement :: Document -> Effect (Maybe Element)
- I see no indication that it may be null
(translated as a Maybe
here) or that it might cause exceptions (which I'm assuming is the reason for Effect
) - would appreciate any understanding on the choice of types here
https://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-element for reference
garyb [4:45 PM]
@ Brandon Barker see the IDL here: https://www.w3.org/TR/dom/#document
it's perhaps a change between dom3 and dom4
you're right that Effect
may be unnecessary here though since the document element is immutable, and it doesn't seem like accessing should raise an exception from a quick scan of the spec
Brandon Barker [9:16 PM]
ah, interesting, didn't know about DOM4
"""
This is regarding the type of the following documentElement
function:
https://github.com/purescript-web/purescript-web-dom/blob/v2.0.0/src/Web/DOM/Document.purs#L89-L89