| Copyright | (c) Andrey Mulik 2019-2021 |
|---|---|
| License | BSD-style |
| Maintainer | work.a.mulik@gmail.com |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Control.Exception.SDP
Contents
Description
Control.Exception.SDP - service module that provide some useful exceptions. Note that SDP.SafePrelude doesn't export this module.
Exports
module Control.Exception
Exceptions
data UnreachableException Source #
A UnreachableException is used as an exception that should never be thrown.
Example: newArray# requires a default value to fill the newly created array.
If the array is guaranteed to be filled with values (for example, in the
replicate function), then this value will never be needed and, therefore,
calculated. UnreachableException in this case will be a marker of
unreachability of this expression.
Constructors
| UnreachableException String |
Instances
| Eq UnreachableException Source # | |
Defined in Control.Exception.SDP Methods (==) :: UnreachableException -> UnreachableException -> Bool # (/=) :: UnreachableException -> UnreachableException -> Bool # | |
| Show UnreachableException Source # | |
Defined in Control.Exception.SDP Methods showsPrec :: Int -> UnreachableException -> ShowS # show :: UnreachableException -> String # showList :: [UnreachableException] -> ShowS # | |
| Exception UnreachableException Source # | |
Defined in Control.Exception.SDP Methods toException :: UnreachableException -> SomeException # fromException :: SomeException -> Maybe UnreachableException # | |
data IndexException Source #
IndexException replaces the less informative ArrayException and has more
neutral names.
UnacceptableExpansion- occurs when performing the (safe) rebound operation with unacceptable target range (example: an attempt to convert structure with bounds(2, 5)to structure with bounds('\0', '\255')is invalid because available size is smaller than required)UnexpectedRank- occurs when trying to convert one representation of an index to another, if their dimensions doesn't match (example: trying to convert a list[1, 2, 3]of type[Int]to an index of type(T4 Int))UndefinedValue- occurs when referring to a non-existent or undefined element; some unsafe structures and operations can lead to the possibility of untracked reading of invalid or undefined valuesEmptyRange- occurs when accessing the contents of an empty structureIndexOverflow- occurs when going beyond the upper boundary of the structure (overflow)IndexUnderflow- occurs when going beyond the lower boundary of the structure (underflow)
If the error type may depend on the check order, it should be indicated in the
documentation. For example: overflow is checked first, and then underflow. But
if an overflow is detected, underflow may not be noticed. IndexException
constructor order is the recommended order.
Constructors
| UnacceptableExpansion String | |
| UndefinedValue String | |
| UnexpectedRank String | |
| IndexUnderflow String | |
| IndexOverflow String | |
| EmptyRange String |
Instances
| Eq IndexException Source # | |
Defined in Control.Exception.SDP Methods (==) :: IndexException -> IndexException -> Bool # (/=) :: IndexException -> IndexException -> Bool # | |
| Show IndexException Source # | |
Defined in Control.Exception.SDP Methods showsPrec :: Int -> IndexException -> ShowS # show :: IndexException -> String # showList :: [IndexException] -> ShowS # | |
| Exception IndexException Source # | |
Defined in Control.Exception.SDP Methods toException :: IndexException -> SomeException # | |