Permalink
Browse files

Clean

  • Loading branch information...
1 parent 68b43a7 commit 565da1960ec4798fbaaf635ad3393e8de0925890 @norm2782 norm2782 committed Nov 1, 2011
Showing with 2 additions and 19 deletions.
  1. +2 −19 tests/in-progress/data_export_wrapper/data_export_wrapper.hs
@@ -3,29 +3,12 @@ import Language.UHC.JScript.Primitives
import Language.UHC.JScript.JQuery.JQuery
import UHC.Ptr
-{-
-
-// define our function with the callback argument
-function some_function(arg1, arg2, callback) {
- // this generates a random number between arg1 and arg2
- var my_number = Math.ceil(Math.random() * (arg1 - arg2) + arg2);
- // then we're done, so we'll call the callback and pass our result
- callback(my_number);
-}
-// call the function
-some_function(5, 15, function(num) {
- // this anonymous function will run when the callback is called
- console.log("callback called! " + num);
-});
-
--}
foreign import jscript "some_function(%*)"
someFun :: Int -> Int -> FunPtr (Int -> IO ()) -> IO ()
-{- foreign import jscript "wrapper"-}
- {- wrap :: (Int -> IO ()) -> IO (FunPtr (Int -> IO ()))-}
-wrap = undefined
+foreign import jscript "wrapper"
+ wrap :: (Int -> IO ()) -> IO (FunPtr (Int -> IO ()))
myCB :: Int -> IO ()
myCB = putStrLn . show

0 comments on commit 565da19

Please sign in to comment.