purescript-web/purescript-web-html

Missing Web.HTML.Window.fromEventTarget

Closed this issue · 1 comments

In a Halogen-Hooks example, this function needs to be manually defined.

-- This function is missing from the purescript-web-html repository
fromEventTarget :: EventTarget -> HTML.Window
fromEventTarget = unsafeCoerce

Is there a reason why it cannot live in this repo?

garyb commented

It certainly can't live in this repo in that form, it's completely unsafe 😄 but yeah, the usual corresponding fromEventTarget :: EventTarget -> Maybe Window is missing. Every toX coerce should have a corresponding fromX conversion.