Skip to content

Remove Unit argument from create functions. #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Web/HTML/HTMLAudioElement.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

exports.create = function () {
return function () {
return new Audio();
};
return new Audio();
};

exports.createWithURL = function (url) {
Expand Down
5 changes: 2 additions & 3 deletions src/Web/HTML/HTMLAudioElement.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Web.HTML.HTMLAudioElement
module Web.HTML.HTMLAudioElement
( HTMLAudioElement
, fromHTMLElement
, fromElement
Expand All @@ -21,7 +21,6 @@ module Web.HTML.HTMLAudioElement

import Data.Maybe (Maybe)
import Effect (Effect)
import Prelude (Unit)
import Unsafe.Coerce (unsafeCoerce)
import Web.DOM (ChildNode, Element, Node, NonDocumentTypeChildNode, ParentNode)
import Web.Event.EventTarget (EventTarget)
Expand Down Expand Up @@ -79,7 +78,7 @@ toParentNode = unsafeCoerce
toEventTarget :: HTMLAudioElement -> EventTarget
toEventTarget = unsafeCoerce

foreign import create :: Unit -> Effect HTMLAudioElement
foreign import create :: Effect HTMLAudioElement
foreign import createWithURL :: String -> Effect HTMLAudioElement

create' :: String -> Effect HTMLAudioElement
Expand Down
5 changes: 1 addition & 4 deletions src/Web/HTML/HTMLImageElement.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

exports.create = function () {
return function () {
return new Image();
};
return new Image();
};

exports.createWithDimensions = function (width) {
Expand Down Expand Up @@ -190,7 +188,6 @@ exports.setReferrerPolicy = function (referrerPolicy) {
};
};


// ----------------------------------------------------------------------------

exports._decoding = function (image) {
Expand Down
3 changes: 1 addition & 2 deletions src/Web/HTML/HTMLImageElement.purs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ toParentNode = unsafeCoerce
toEventTarget :: HTMLImageElement -> EventTarget
toEventTarget = unsafeCoerce


foreign import create :: Unit -> Effect HTMLImageElement
foreign import create :: Effect HTMLImageElement
foreign import createWithDimensions :: Int -> Int -> Effect HTMLImageElement

create' :: Int -> Int -> Effect HTMLImageElement
Expand Down