try -cgi

try :: IO a -> IO (Either Exception a)
base Control.OldException
Similar to catch, but returns an Either result which is (Right a) if no exception was raised, or (Left e) if an exception was raised and its value is e. > try a = catch (Right `liftM` a) (return . Left) Note: as with catch, it is only polite to use this variant if you intend to re-throw the exception after performing whatever cleanup is needed. Otherwise, tryJust is generally considered to be better. Also note that System.IO.Error also exports a function called System.IO.Error.try with a similar type to try, except that it catches only the IO and user families of exceptions (as required by the Haskell 98 IO module).
try :: IO a -> IO (Either IOError a)
base System.IO.Error
The construct try comp exposes IO errors which occur within a computation, and which are not fully handled. Non-I/O exceptions are not caught by this variant; to catch all exceptions, use Control.Exception.try from Control.Exception.
try :: Exception e => IO a -> IO (Either e a)
base Control.Exception.Base, base Control.Exception
Similar to catch, but returns an Either result which is (Right a) if no exception of type e was raised, or (Left ex) if an exception of type e was raised and its value is ex. If any other type of exception is raised than it will be propogated up to the next enclosing exception handler. > try a = catch (Right `liftM` a) (return . Left) Note that System.IO.Error also exports a function called System.IO.Error.try with a similar type to Control.Exception.try, except that it catches only the IO and user families of exceptions (as required by the Haskell 98 IO module).
try :: GenParser tok st a -> GenParser tok st a
parsec Text.ParserCombinators.Parsec.Prim
try :: ParsecT s u m a -> ParsecT s u m a
parsec Text.Parsec.Prim
The parser try p behaves like parser p, except that it pretends that it hasn't consumed any input when an error occurs. This combinator is used whenever arbitrary look ahead is needed. Since it pretends that it hasn't consumed any input when p fails, the (<|>) combinator will try its second alternative even when the first parser failed while consuming input. The try combinator can for example be used to distinguish identifiers and reserved words. Both reserved words and identifiers are a sequence of letters. Whenever we expect a certain reserved word combinator. Suppose we write: > expr = letExpr <|> identifier <?> "expression" > > letExpr = do{ string "let"; ... } > identifier = many1 letter If the user writes "lexical", the parser fails with: unexpected 'x', expecting 't' in "let". Indeed, since the (<|>) combinator only tries alternatives when the first alternative hasn't consumed input, the identifier parser is never tried (because the prefix "le" of the string "let" parser is already consumed). The right behaviour can be obtained by adding the try combinator: > expr = letExpr <|> identifier <?> "expression" > > letExpr = do{ try (string "let"); ... } > identifier = many1 letter
tryJust :: (Exception -> Maybe b) -> IO a -> IO (Either b a)
base Control.OldException
A variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown.
tryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)
base Control.Exception.Base, base Control.Exception
A variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown.
tryPutMVar :: MVar a -> a -> IO Bool
base Control.Concurrent.MVar
A non-blocking version of putMVar. The tryPutMVar function attempts to put the value a into the MVar, returning True if it was successful, or False otherwise.
tryTakeMVar :: MVar a -> IO (Maybe a)
base Control.Concurrent.MVar
A non-blocking version of takeMVar. The tryTakeMVar function returns immediately, with Nothing if the MVar was empty, or Just a if the MVar was full with contents a. After tryTakeMVar, the MVar is left empty.
tryPeekTBQueue :: TBQueue a -> STM (Maybe a)
stm Control.Concurrent.STM.TBQueue
A version of peekTBQueue which does not retry. Instead it returns Nothing if no value is available.
tryPeekTChan :: TChan a -> STM (Maybe a)
stm Control.Concurrent.STM.TChan
A version of peekTChan which does not retry. Instead it returns Nothing if no value is available.
tryPeekTQueue :: TQueue a -> STM (Maybe a)
stm Control.Concurrent.STM.TQueue
A version of peekTQueue which does not retry. Instead it returns Nothing if no value is available.
tryPutTMVar :: TMVar a -> a -> STM Bool
stm Control.Concurrent.STM.TMVar
A version of putTMVar that does not retry. The tryPutTMVar function attempts to put the value a into the TMVar, returning True if it was successful, or False otherwise.
tryReadTBQueue :: TBQueue a -> STM (Maybe a)
stm Control.Concurrent.STM.TBQueue
A version of readTBQueue which does not retry. Instead it returns Nothing if no value is available.
tryReadTChan :: TChan a -> STM (Maybe a)
stm Control.Concurrent.STM.TChan
A version of readTChan which does not retry. Instead it returns Nothing if no value is available.
tryReadTMVar :: TMVar a -> STM (Maybe a)
stm Control.Concurrent.STM.TMVar
A version of readTMVar which does not retry. Instead it returns Nothing if no value is available.
tryReadTQueue :: TQueue a -> STM (Maybe a)
stm Control.Concurrent.STM.TQueue
A version of readTQueue which does not retry. Instead it returns Nothing if no value is available.
tryTakeTMVar :: TMVar a -> STM (Maybe a)
stm Control.Concurrent.STM.TMVar
A version of takeTMVar that does not retry. The tryTakeTMVar function returns Nothing if the TMVar was empty, or Just a if the TMVar was full with contents a. After tryTakeTMVar, the TMVar is left empty.
TryDirectContext :: DirectRendering
GLUT Graphics.UI.GLUT.Initialization
Try to use direct rendering, issue a warning and use indirect rendering if this is not possible.
throwErrnoIfMinus1Retry :: Num a => String -> IO a -> IO a
base Foreign.C.Error
Throw an IOError corresponding to the current value of getErrno if the IO action returns a result of -1, but retries in case of an interrupted operation.

Show more results