# Pastebin qupWpv3D {-# LANGUAGE ScopedTypeVariables #-} module Main where import Control.Monad import GHCJS.DOM import GHCJS.DOM.Document import GHCJS.DOM.Node import GHCJS.DOM.Types import GHCJS.Marshal import GHCJS.Types import JavaScript.Web.Canvas main :: IO () main = do -- Create canvas Just doc <- currentDocument Just body <- getBody doc canvas <- create 500 500 -- Casting Just (ele :: HTMLCanvasElement) <- fromJSVal (jsval canvas) -- Add to body void $ appendChild body $ Just ele -- Draw circle ctx <- getContext canvas beginPath ctx arc 95 80 52 0 (2*pi) False ctx stroke ctx