From ed0036025b3371a9b3ce74968e36ec99718ceabc Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Sat, 12 Dec 2020 10:29:09 -0800 Subject: [PATCH] Remove Unit argument from create functions. (#46) * Remove Unit argument from create functions. * Remove unused Unit import Co-authored-by: JordanMartinez --- src/Web/HTML/HTMLAudioElement.js | 4 +--- src/Web/HTML/HTMLAudioElement.purs | 5 ++--- src/Web/HTML/HTMLImageElement.js | 5 +---- src/Web/HTML/HTMLImageElement.purs | 3 +-- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Web/HTML/HTMLAudioElement.js b/src/Web/HTML/HTMLAudioElement.js index efa1323..7741b38 100644 --- a/src/Web/HTML/HTMLAudioElement.js +++ b/src/Web/HTML/HTMLAudioElement.js @@ -1,9 +1,7 @@ "use strict"; exports.create = function () { - return function () { - return new Audio(); - }; + return new Audio(); }; exports.createWithURL = function (url) { diff --git a/src/Web/HTML/HTMLAudioElement.purs b/src/Web/HTML/HTMLAudioElement.purs index 536e1de..4d99110 100644 --- a/src/Web/HTML/HTMLAudioElement.purs +++ b/src/Web/HTML/HTMLAudioElement.purs @@ -1,4 +1,4 @@ -module Web.HTML.HTMLAudioElement +module Web.HTML.HTMLAudioElement ( HTMLAudioElement , fromHTMLElement , fromElement @@ -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) @@ -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 diff --git a/src/Web/HTML/HTMLImageElement.js b/src/Web/HTML/HTMLImageElement.js index 0878d39..60c01bd 100644 --- a/src/Web/HTML/HTMLImageElement.js +++ b/src/Web/HTML/HTMLImageElement.js @@ -1,9 +1,7 @@ "use strict"; exports.create = function () { - return function () { - return new Image(); - }; + return new Image(); }; exports.createWithDimensions = function (width) { @@ -190,7 +188,6 @@ exports.setReferrerPolicy = function (referrerPolicy) { }; }; - // ---------------------------------------------------------------------------- exports._decoding = function (image) { diff --git a/src/Web/HTML/HTMLImageElement.purs b/src/Web/HTML/HTMLImageElement.purs index c049d4a..0ef8f78 100644 --- a/src/Web/HTML/HTMLImageElement.purs +++ b/src/Web/HTML/HTMLImageElement.purs @@ -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