Closed ivanperez-keera closed 8 years ago
I'm sorry about that. The tests are a couple of years old. Diagrams has changed a lot, and GHCJS even more so. I'm not sure when I'll have time to get them working again.
In the meantime, any of the examples in the Diagrams manual should work. My GHCJS examples page has two examples of using Diagrams with GHCJS, near the bottom of the page.
Thanks for the link to your examples. I was able to make the canvas example work with some minor modifications. I created a modified version of haskanoid and put it online.
Thank you for sharing those! The arkanoid is exciting. Would you mind sending me a pull request with the changes needed for the canvas example?
There is only one tiny problem: I had to modify one of ghcjs's libraries to expose the canvas constructor. I did it using unsafeToCanvas
, but that is just Canvas
(data constructor). On the one hand, flagging all canvas-related code as unsafe may not sound very appealing. On the other, there are reasons to hide internal constructors.
Which one would be best in this case?
There's an open PR to export unsafeToCanvas
. As far as I know, no one has yet implemented toCanvas
; the current version is a placeholder. What would be best is to implement toCanvas
, but I think in the short term, it's fine to use unsafeToCanvas
and depend on a version of ghcjs-base
that exports it.
The tests throw a lot of errors. They refer to an old
JavaScript.Canvas
module (is thatJavaScript.Web.Canvas
?) and the constraint:does not seem valid (?) because R2 is a type class.
I played around with it for some time but I just can't compile it. Help updating the example would be appreciated.