Conversation
55946fe to
e030606
Compare
JordanMartinez
left a comment
There was a problem hiding this comment.
Waiting for your response on the below question. I believe the extra Unit -> isn't necessary. If so, you'll need to update the FFI.
| toEventTarget :: HTMLAudioElement -> EventTarget | ||
| toEventTarget = unsafeCoerce | ||
|
|
||
| foreign import create :: Unit -> Effect HTMLAudioElement |
There was a problem hiding this comment.
Why isn't this just create :: Effect HTMLAudioElement? Why the extra Unit -> arg?
There was a problem hiding this comment.
You're correct that the Unit isn't necessary, but @toastal is following the existing pattern from the bindings from HTMLImageElement.
There was a problem hiding this comment.
That's why I accepted it here, though the Unit is unnecessary. @hdgarrood would you also be open to fixing these functions so that they're just in Effect right now?
There was a problem hiding this comment.
Ah... That makes more sense. Why were they originally Unit -> Effect result?
There was a problem hiding this comment.
Now that I don't know. 🤷♀️
There was a problem hiding this comment.
I would be open to that, yes. I also don’t know why they’re like this. I generally haven’t been very involved with the web libraries, actually.
There was a problem hiding this comment.
Ah... That makes more sense. Why were they originally
Unit -> Effect result?
'tis a mystery to me also, even though I'm probably the one who did it 🤔
Borrowing the
createandcreate'fromHTMLImageElement,Audioexists much in the same way.