purescript-web/purescript-web-dom

`ElementId` type

Closed this issue · 2 comments

Description

After reading an old comment from a Halogen maintainer, it seems to me that the lack of a newtype wrapper for a value of the element id property/attribute could be considered a missing feature that, had it existed, would have been ported to web-html along with ClassName, AttrName, and PropName.

At the same time, in #56 I suggest that perhaps those types belong in this library instead of web-html, which is why I am creating the issue here.

In short, I am suggesting that, if #56 is accepted, an ElementId type ought to be added as well.

Prerequisites

Note
None of the newtype wrappers mentioned above, including the proposed ElementId, are mentioned in the spec, but neither are they in the HTML standard.

garyb commented

Seems reasonable to me 👍. I'd probably lean towards ElementId, although I don't have any reasoned justification for it.

Thanks @garyb, I was on the fence myself, so I've updated the proposed type name to ElementId.