messageBox :: [MessageBoxType] -> Exp String -> Action (Exp String)
messageBox ty x = do
    let a*b = (a, words b)
    let alts = [MB_OK * "OK"
               ,MB_OKCANCEL * "OK CANCEL"
               ,MB_ABORTRETRYIGNORE * "ABORT RETRY IGNORE"
               ,MB_RETRYCANCEL * "RETRY CANCEL"
               ,MB_YESNO * "YES NO"
               ,MB_YESNOCANCEL * "YES NO CANCEL"]
    let (btns,rest) = partition (`elem` map fst alts) ty
    let btn = last $ MB_OK : btns
    let alt = fromJust $ lookup btn alts

    end <- newLabel
    lbls <- replicateM (length alt) newLabel
    v <- mutable_ ""
    Value x <- x
    emit $ MessageBox (btn:rest) x $ zip alt lbls
    forM_ (zip alt lbls) $ \(a,l) -> do
        label l
        v @= fromString a
        goto end
    label end
    return v
messageBox :: [MessageBoxType] -> Exp String -> Action (Exp String)
messageBox ty x = do
    let a*b = (a, words b)
    let alts = [MB_OK * "OK"
               ,MB_OKCANCEL * "OK CANCEL"
               ,MB_ABORTRETRYIGNORE * "ABORT RETRY IGNORE"
               ,MB_RETRYCANCEL * "RETRY CANCEL"
               ,MB_YESNO * "YES NO"
               ,MB_YESNOCANCEL * "YES NO CANCEL"]
    let (btns,rest) = partition (`elem` map fst alts) ty
    let btn = last $ MB_OK : btns
    let alt = fromJust $ lookup btn alts

    end <- newLabel
    lbls <- replicateM (length alt) newLabel
    v <- mutable_ ""
    Value x <- x
    emit $ MessageBox (btn:rest) x $ zip alt lbls
    forM_ (zip alt lbls) $ \(a,l) -> do
        label l
        v @= fromString a
        goto end
    label end
    return v
messageBox ty x = do
    let a*b = (a, words b)
    let alts = [MB_OK * "OK"
               ,MB_OKCANCEL * "OK CANCEL"
               ,MB_ABORTRETRYIGNORE * "ABORT RETRY IGNORE"
               ,MB_RETRYCANCEL * "RETRY CANCEL"
               ,MB_YESNO * "YES NO"
               ,MB_YESNOCANCEL * "YES NO CANCEL"]
    let (btns,rest) = partition (`elem` map fst alts) ty
    let btn = last $ MB_OK : btns
    let alt = fromJust $ lookup btn alts

    end <- newLabel
    lbls <- replicateM (length alt) newLabel
    v <- mutable_ ""
    Value x <- x
    emit $ MessageBox (btn:rest) x $ zip alt lbls
    forM_ (zip alt lbls) $ \(a,l) -> do
        label l
        v @= fromString a
        goto end
    label end
    return v