-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Choice for IO and lifted IO
--   
--   Choice for IO and lifted IO
@package io-choice
@version 0.0.6

-- | This package provides a function to generate a choice operator in IO
--   monad by specifying exceptions to be caught.
module Control.Exception.IOChoice.TH

-- | A function to generate a choice operator in IO monad.
--   IOException is automatically added to specified exceptions. So,
--   goNext can be used with the new operator.
--   
--   
--   {-# LANGUAGE TemplateHaskell #-}
--   import Control.Exception
--   import Control.Exception.IOChoice.TH
--   
--   (||>>) :: IO a -> IO a -> IO a
--   (||>>) = $(newIOChoice [''ErrorCall, ''ArithException])
--   
newIOChoice :: [Name] -> ExpQ

-- | This package provides a function to generate a choice operator in
--   lifted IO monad by specifying exceptions to be caught.
module Control.Exception.IOChoice.Lifted.TH

-- | A function to generate a choice operator in lifted IO monad.
--   IOException is automatically added to specified exceptions. So,
--   goNext can be used with the new operator.
--   
--   
--   {-# LANGUAGE TemplateHaskell #-}
--   import Control.Exception
--   import Control.Exception.IOChoice.Lifted.TH
--   
--   (||>>) :: MonadBaseControl IO m => m a -> m a -> m a
--   (||>>) = $(newIOChoice [''ErrorCall, ''ArithException])
--   
newIOChoice :: [Name] -> ExpQ

-- | This package provides the choice operator (||>) for lifted
--   IO monad.
module Control.Exception.IOChoice.Lifted

-- | If IOException occurs or goNext is used in the left
--   monad, then the right monad is performed. Note that fail throws
--   IOException.
(||>) :: MonadBaseControl IO m => m a -> m a -> m a
infixr 3 ||>

-- | Go to the next IO monad by throwing IOException.
goNext :: (MonadIO m, MonadBase IO m) => m a

-- | Run any one lifted IO monad.
runAnyOne :: (MonadIO m, MonadBaseControl IO m) => [m a] -> m a

-- | This package provides the choice operator (||>) for IO
--   monad.
module Control.Exception.IOChoice

-- | If IOException occurs or goNext is used in the left IO,
--   then the right IO is performed. Note that fail throws
--   IOException.
(||>) :: IO a -> IO a -> IO a
infixr 3 ||>

-- | Go to the next IO monad by throwing IOException.
goNext :: IO a

-- | Run any one IO monad.
runAnyOne :: [IO a] -> IO a
