Permalink
Browse files

Cleanup

  • Loading branch information...
1 parent f9f4220 commit 8f55b2381c58d68f240982004f5060bfa1e50ffa @norm2782 norm2782 committed Nov 4, 2011
Showing with 3 additions and 21 deletions.
  1. +3 −21 tests/in-progress/import_dynamic/import_dynamic.hs
@@ -6,32 +6,14 @@ import UHC.Ptr
foreign import jscript "getJSFun(%1)"
- getJSFun :: Int -> FunPtr (Int -> Int)
+ getJSFun :: Int -> IO (FunPtr (Int -> Int))
foreign import jscript "dynamic"
mkDyn :: FunPtr (Int -> Int) -> (Int -> Int)
main :: IO ()
main = do
putStrLn "import_dynamic"
- let jfn = getJSFun 2
- let hfn = mkDyn jfn
- print $ hfn 3
+ jfn <- getJSFun 2
+ print $ (mkDyn jfn) 3
-{-
-
-Suppose we get some function: function(y) { return ... ; }
-
-We then want to wrap it in:
-
-$import_dynamic.$mkDyn =
- new _F_("import_dynamic.mkDyn", function($__, $__2) {
- var $__3 = _e_($__);
- var $__4 = new _F_("", function(vr1) {
- var $__5 = _e_(vr1);
- return [$__($__5), $__2];
- });
- return $__4;
- });
-
--}

0 comments on commit 8f55b23

Please sign in to comment.