Permalink
Browse files

Now with the worker file

  • Loading branch information...
1 parent 01721cf commit d613e6633a839daeb16af61981ebe1a50ec48f00 @spockz committed Jan 18, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 resources/static/hjs/Worker.hs
@@ -0,0 +1,21 @@
+module Main where
+
+import Language.UHC.JScript.WebWorker
+
+import Language.UHC.JScript.Prelude
+import Language.Prolog.NanoProlog.NanoProlog
+
+import Prolog
+
+main = do self <- getSelf
+ setOnMessage self doCheck
+ return ()
+
+doCheck :: JSPtr a -> IO ()
+doCheck obj = do (proof, rules) <- getAttr "data" obj
+ -- let (proof, rules) = (read :: String -> (Proof, [Rule])) str
+ self <- getSelf
+ postMessage self $ checkProof rules proof
+
+foreign import jscript "JSON.parse(%1)"
+ jsonParse :: JSString -> IO a

0 comments on commit d613e66

Please sign in to comment.