Skip to content

Commit

Permalink
Rename ElementClass to IsElement
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Jun 30, 2013
1 parent 401b16d commit 3517ae2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions weblog/mouse/mouse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import FRP.Sodium
import GHCJS.DOM (runWebGUI, currentDocument)
import GHCJS.DOM.DOMWindow (domWindowGetDocument)
import GHCJS.DOM.Types (HTMLElement, Element, unHTMLElement,
ElementClass(..))
IsElement(..))
import GHCJS.DOM.Document (documentCreateElementNS,
documentGetElementsByTagName, documentGetBody)
import GHCJS.DOM.Node (nodeAppendChild)
Expand All @@ -30,7 +30,7 @@ createSvg n = do
Just doc <- currentDocument
documentCreateElementNS doc ("http://www.w3.org/2000/svg"::String) n

setAttribute' :: (ElementClass o, ToJSRef v) => JSString -> v -> o -> IO ()
setAttribute' :: (IsElement o, ToJSRef v) => JSString -> v -> o -> IO ()
setAttribute' a v o = toJSRef v >>= \v' -> elementSetAttribute o a (castRef v' :: JSString)

main =
Expand Down Expand Up @@ -70,7 +70,7 @@ drawObject parent color r x = do
\(x,y) -> "cx" .= x >> "cy" .= y
return ()

mousePosition :: ElementClass e => e -> IO (Behaviour (Double, Double))
mousePosition :: IsElement e => e -> IO (Behaviour (Double, Double))
mousePosition elem = do
(b, push) <- sync $ newBehaviour (0,0)
let handler ev = do
Expand Down

0 comments on commit 3517ae2

Please sign in to comment.