{-# OPTIONS_GHC -XEmptyDataDecls -XScopedTypeVariables #-} module NET.System.Action (module NET.System.Action, module NET.System.Action.Type ) where import NET import NET.System.Action.Type newAction :: (Arg ty, Type ty) => (ty -> Action ty a -> IO ()) -> IO (Action ty a) newAction hAction = do let ts = tyName (tyFunArg hAction ) obj <- case length ts of 0 -> newDelegator1_ "System.Action" (\ this -> do { (v, _) <- fromArgs [] ; hAction v (castObjTy this) }) 1 -> newDelegator2_ (toGenericTypeString "System.Action" ts) ( \ a b -> do (v,_) <- fromArgs [a] th <- mkObject b hAction v th) 2 -> newDelegator3_ (toGenericTypeString "System.Action" ts) ( \ a b c -> do (v,_) <- fromArgs [a,b] th <- mkObject c hAction v th) return (castObjTy obj) invokeAction :: (Arg ty, Type ty) => ty -> Action a ty -> IO () invokeAction arg obj = obj # invoke_ "Invoke" arg