{-# LANGUAGE Safe #-}
module Control.Exception.SDP
(
module Control.Exception,
UnreachableException (..), IndexException (..)
)
where
import Prelude ( Eq (..), Show (..), String, (++) )
import Control.Exception
import Data.Typeable
default ()
data IndexException = UnacceptableExpansion String
| UndefinedValue String
| UnexpectedRank String
| IndexUnderflow String
| IndexOverflow String
| EmptyRange String
deriving ( IndexException -> IndexException -> Bool
(IndexException -> IndexException -> Bool)
-> (IndexException -> IndexException -> Bool) -> Eq IndexException
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexException -> IndexException -> Bool
$c/= :: IndexException -> IndexException -> Bool
== :: IndexException -> IndexException -> Bool
$c== :: IndexException -> IndexException -> Bool
Eq, Typeable )
instance Show IndexException
where
show :: IndexException -> String
show (UnacceptableExpansion String
s) = String
"unacceptable expansion " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
show (UndefinedValue String
s) = String
"undefined element " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
show (UnexpectedRank String
s) = String
"unexpected rank " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
show (IndexUnderflow String
s) = String
"index out of lower bound " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
show (IndexOverflow String
s) = String
"index out of upper bound " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
show (EmptyRange String
s) = String
"empty range " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
instance Exception IndexException
data UnreachableException = UnreachableException String deriving (UnreachableException -> UnreachableException -> Bool
(UnreachableException -> UnreachableException -> Bool)
-> (UnreachableException -> UnreachableException -> Bool)
-> Eq UnreachableException
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnreachableException -> UnreachableException -> Bool
$c/= :: UnreachableException -> UnreachableException -> Bool
== :: UnreachableException -> UnreachableException -> Bool
$c== :: UnreachableException -> UnreachableException -> Bool
Eq, Typeable)
instance Show UnreachableException
where
show :: UnreachableException -> String
show (UnreachableException String
s) = String
"unreachable exception " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
instance Exception UnreachableException