cryptonite-0.25: Cryptography Primitives sink

Crypto.Error

Description

# Documentation

Enumeration of all possible errors that can be found in this library

Instances

 Source # Methods Source # Methods Source # Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CryptoError -> c CryptoError #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CryptoError #dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CryptoError) #dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CryptoError) #gmapT :: (forall b. Data b => b -> b) -> CryptoError -> CryptoError #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CryptoError -> r #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CryptoError -> r #gmapQ :: (forall d. Data d => d -> u) -> CryptoError -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> CryptoError -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> CryptoError -> m CryptoError #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CryptoError -> m CryptoError #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CryptoError -> m CryptoError # Source # MethodsshowList :: [CryptoError] -> ShowS # Source # Methods

A simple Either like type to represent a computation that can fail

2 possibles values are:

• CryptoPassed : The computation succeeded, and contains the result of the computation
• CryptoFailed : The computation failed, and contains the cryptographic error associated

Constructors

 CryptoPassed a CryptoFailed CryptoError

Instances

 Source # Methods(>>=) :: CryptoFailable a -> (a -> CryptoFailable b) -> CryptoFailable b #return :: a -> CryptoFailable a # Source # Methodsfmap :: (a -> b) -> CryptoFailable a -> CryptoFailable b #(<\$) :: a -> CryptoFailable b -> CryptoFailable a # Source # Methodspure :: a -> CryptoFailable a #(<*>) :: CryptoFailable (a -> b) -> CryptoFailable a -> CryptoFailable b #liftA2 :: (a -> b -> c) -> CryptoFailable a -> CryptoFailable b -> CryptoFailable c # Source # Associated Typestype Failure (CryptoFailable :: * -> *) :: * # Methods Eq a => Eq (CryptoFailable a) Source # Methods(==) :: CryptoFailable a -> CryptoFailable a -> Bool #(/=) :: CryptoFailable a -> CryptoFailable a -> Bool # Show a => Show (CryptoFailable a) Source # MethodsshowsPrec :: Int -> CryptoFailable a -> ShowS #showList :: [CryptoFailable a] -> ShowS # Source #

Throw an CryptoError as exception on CryptoFailed result, otherwise return the computed value

Same as throwCryptoErrorIO but throw the error asynchronously.

onCryptoFailure :: (CryptoError -> r) -> (a -> r) -> CryptoFailable a -> r Source #

Simple either like combinator for CryptoFailable type

Transform a CryptoFailable to an Either

Transform a CryptoFailable to a Maybe