loop :: (Action () -> Action ()) -> Action ()
loop body = do
    end <- newLabel
    beg <- newLabel
    label beg
    scope $ body $ goto end
    goto beg
    label end

-- | Run an intitial action, and if that action causes an error, run the second action.
--   Unlike other programming languages, any uncaught errors are silently ignored.
--   All actions are run in 'scope'.
--
-- @
-- 'onError' ('exec' \"\\\"$WINDIR/notepad.exe\\\"\") ('alert' \"Failed to run notepad\")
-- @
loop :: (Action () -> Action ()) -> Action ()
loop body = do
    end <- newLabel
    beg <- newLabel
    label beg
    scope $ body $ goto end
    goto beg
    label end

-- | Run an intitial action, and if that action causes an error, run the second action.
--   Unlike other programming languages, any uncaught errors are silently ignored.
--   All actions are run in 'scope'.
--
-- @
-- 'onError' ('exec' \"\\\"$WINDIR/notepad.exe\\\"\") ('alert' \"Failed to run notepad\")
-- @
loop body = do
    end <- newLabel
    beg <- newLabel
    label beg
    scope $ body $ goto end
    goto beg
    label end

-- | Run an intitial action, and if that action causes an error, run the second action.
--   Unlike other programming languages, any uncaught errors are silently ignored.
--   All actions are run in 'scope'.
--
-- @
-- 'onError' ('exec' \"\\\"$WINDIR/notepad.exe\\\"\") ('alert' \"Failed to run notepad\")
-- @