Commits

Alex Suraci  committed 8b9883d

updates & fixes for latest Atomo
Ignore-this: 7c293cee15dcb460f1d48e16bae0b2da

  • Participants
  • Parent commits eaff981

Comments (0)

Files changed (2)

 
 load :: VM ()
 load = do
-    eval [$e|super Context = Object clone|]
+    ([$p|super Context|] =::) =<< eval [$e|Object clone|]
 
     [$p|Context new: (size: Integer)|] =: do
         here "size"
             >>= liftIO . Z.init . fromIntegral
             >>= toValue
 
-    eval [$e|Socket = Object clone|]
+    ([$p|Socket|] =::) =<< eval [$e|Object clone|]
     [$p|(s: Socket) show|] =::: [$e|"<socket " .. s type show .. ">"|]
 
     [$p|(c: Context) terminate|] =: do
 withSubSocket :: (Z.Socket Z.Sub -> IO b) -> Value -> VM b
 withSubSocket f sock =
     dispatch (single "socket" sock)
-        >>= fromHaskell "Socket Sub"
+        >>= fromHaskell
         >>= liftIO . f
 
 
 
     case t of
         PMSingle "push" -> do
-            s' <- fromHaskell "Socket Push" s :: VM (Z.Socket Z.Push)
+            s' <- fromHaskell s :: VM (Z.Socket Z.Push)
             liftIO (f s')
         PMSingle "pull" -> do
-            s' <- fromHaskell "Socket Pull" s :: VM (Z.Socket Z.Pull)
+            s' <- fromHaskell s :: VM (Z.Socket Z.Pull)
             liftIO (f s')
         PMSingle "xrep" -> do
-            s' <- fromHaskell "Socket Xrep" s :: VM (Z.Socket Z.XRep)
+            s' <- fromHaskell s :: VM (Z.Socket Z.XRep)
             liftIO (f s')
         PMSingle "xreq" -> do
-            s' <- fromHaskell "Socket Xreq" s :: VM (Z.Socket Z.XReq)
+            s' <- fromHaskell s :: VM (Z.Socket Z.XReq)
             liftIO (f s')
         PMSingle "rep" -> do
-            s' <- fromHaskell "Socket Rep" s :: VM (Z.Socket Z.Rep)
+            s' <- fromHaskell s :: VM (Z.Socket Z.Rep)
             liftIO (f s')
         PMSingle "req" -> do
-            s' <- fromHaskell "Socket Req" s :: VM (Z.Socket Z.Req)
+            s' <- fromHaskell s :: VM (Z.Socket Z.Req)
             liftIO (f s')
         PMSingle "sub" -> do
-            s' <- fromHaskell "Socket Sub" s :: VM (Z.Socket Z.Sub)
+            s' <- fromHaskell s :: VM (Z.Socket Z.Sub)
             liftIO (f s')
         PMSingle "pub" -> do
-            s' <- fromHaskell "Socket Pub" s :: VM (Z.Socket Z.Pub)
+            s' <- fromHaskell s :: VM (Z.Socket Z.Pub)
             liftIO (f s')
         PMSingle "pair" -> do
-            s' <- fromHaskell "Socket Pair" s :: VM (Z.Socket Z.Pair)
+            s' <- fromHaskell s :: VM (Z.Socket Z.Pair)
             liftIO (f s')
 
 
     toValue x = do
         c <- eval [$e|Context clone|]
         [$p|c|] =:: c
-        [$p|c context|] =:: haskell x
+        [$p|{ c } context|] =:: haskell x
         return c
 
-    fromValue v = dispatch (single "context" v) >>= fromHaskell "Context"
+    fromValue v = dispatch (single "context" v) >>= fromHaskell
 
 instance Typeable a => Valuable (Z.Socket a) where
     toValue x = do
         s <- eval [$e|Socket clone|]
         [$p|s|] =:: s
-        [$p|s socket|] =:: haskell x
+        [$p|{ s } socket|] =:: haskell x
         return s
 
-    fromValue v = dispatch (single "socket" v) >>= fromHaskell "Socket a"
+    fromValue v = dispatch (single "socket" v) >>= fromHaskell
 
 instance Valuable Z.SocketOption where
     toValue o = return (par o)
 name: "zeromq"
 description: "wrapper for zeromq-haskell"
 author: "Alex Suraci"
-version: 0 . 1
+version: (0 . 1)