Created
October 7, 2015 18:19
-
-
Save et4te/314a73f5047ead28418f to your computer and use it in GitHub Desktop.
Line 24 is where I am confused
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkCanvas' :: CanvasInfo -> IO (OCanvasRef) | |
| mkCanvas' cnvInfo = do | |
| cnvObj <- toJSRef cnvInfo | |
| cnvRef <- js_create cnvObj | |
| js_setWidth cnvRef (toJSInt $ width cnvInfo) | |
| js_setHeight cnvRef (toJSInt $ height cnvInfo) | |
| return cnvRef | |
| mkCanvas :: (MonadWidget t m) => Event t CanvasInfo -> m (Event t OCanvasRef) | |
| mkCanvas cnvInfoE = do | |
| performEvent $ fmap (liftIO . mkCanvas') cnvInfoE | |
| canvasDisplay' :: OCanvasRef -> ImageInfo -> IO (OImageRef) | |
| canvasDisplay' cnvRef imgInfo = do | |
| imgInfoRef <- toJSRef imgInfo | |
| imgRef <- js_display cnvRef imgInfoRef | |
| return imgRef | |
| canvasDisplay :: (MonadWidget t m) => Event t OCanvasRef -> Dynamic t ImageInfo -> m (Event t OImageRef) | |
| canvasDisplay cnvRefE imgInfoD = do | |
| cnvRefD <- foldDynMaybe notNull jsNull cnvRefE | |
| let cnvImgE = attachDyn cnvRefD (updated imgInfoD) | |
| performEvent $ fmap (liftIO . canvasDisplay') cnvImgE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment