Basement.Exception

basement-0.0.15: Foundation scrap box of array & string

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

Basement.Exception

Description

Common part for vectors

Synopsis

- data OutOfBound = OutOfBound OutOfBoundOperation Int Int
- data OutOfBoundOperation
  - = OOB_Read
  - | OOB_Write
  - | OOB_MemSet
  - | OOB_MemCopy
  - | OOB_Index
- isOutOfBound :: Offset ty -> CountOf ty -> Bool
- outOfBound :: OutOfBoundOperation -> Offset ty -> CountOf ty -> a
- primOutOfBound :: PrimMonad prim => OutOfBoundOperation -> Offset ty -> CountOf ty -> prim a
- data InvalidRecast = InvalidRecast RecastSourceSize RecastDestinationSize
- newtype RecastSourceSize = RecastSourceSize Int
- newtype RecastDestinationSize = RecastDestinationSize Int
- data NonEmptyCollectionIsEmpty = NonEmptyCollectionIsEmpty

# Documentation

data OutOfBound #

Exception during an operation accessing the vector out of bound

Represent the type of operation, the index accessed, and the total length of the vector.

Constructors

OutOfBound OutOfBoundOperation Int Int |

#### Instances

Instances details

Exception OutOfBound # |
Instance details Defined in Basement.Exception Methods toException :: OutOfBound -> SomeException fromException :: SomeException -> Maybe OutOfBound displayException :: OutOfBound -> String
Show OutOfBound # |
Instance details Defined in Basement.Exception Methods showsPrec :: Int -> OutOfBound -> ShowS # show :: OutOfBound -> String # showList :: [OutOfBound] -> ShowS #

data OutOfBoundOperation #

The type of operation that triggers an OutOfBound exception.

- OOB_Index: reading an immutable vector
- OOB_Read: reading a mutable vector
- OOB_Write: write a mutable vector
- OOB_MemCopy: copying a vector
- OOB_MemSet: initializing a mutable vector

Constructors

OOB_Read |
OOB_Write |
OOB_MemSet |
OOB_MemCopy |
OOB_Index |

#### Instances

Instances details

Show OutOfBoundOperation # |
Instance details Defined in Basement.Exception Methods showsPrec :: Int -> OutOfBoundOperation -> ShowS # show :: OutOfBoundOperation -> String # showList :: [OutOfBoundOperation] -> ShowS #
Eq OutOfBoundOperation # |
Instance details Defined in Basement.Exception Methods (==) :: OutOfBoundOperation -> OutOfBoundOperation -> Bool # (/=) :: OutOfBoundOperation -> OutOfBoundOperation -> Bool #

isOutOfBound :: Offset ty -> CountOf ty -> Bool #

outOfBound :: OutOfBoundOperation -> Offset ty -> CountOf ty -> a #

primOutOfBound :: PrimMonad prim => OutOfBoundOperation -> Offset ty -> CountOf ty -> prim a #

data InvalidRecast #

Constructors

InvalidRecast RecastSourceSize RecastDestinationSize |

#### Instances

Instances details

Exception InvalidRecast # |
Instance details Defined in Basement.Exception Methods toException :: InvalidRecast -> SomeException fromException :: SomeException -> Maybe InvalidRecast displayException :: InvalidRecast -> String
Show InvalidRecast # |
Instance details Defined in Basement.Exception Methods showsPrec :: Int -> InvalidRecast -> ShowS # show :: InvalidRecast -> String # showList :: [InvalidRecast] -> ShowS #

newtype RecastSourceSize #

Constructors

RecastSourceSize Int |

#### Instances

Instances details

Show RecastSourceSize # |
Instance details Defined in Basement.Exception Methods showsPrec :: Int -> RecastSourceSize -> ShowS # show :: RecastSourceSize -> String # showList :: [RecastSourceSize] -> ShowS #
Eq RecastSourceSize # |
Instance details Defined in Basement.Exception Methods (==) :: RecastSourceSize -> RecastSourceSize -> Bool # (/=) :: RecastSourceSize -> RecastSourceSize -> Bool #

newtype RecastDestinationSize #

Constructors

RecastDestinationSize Int |

#### Instances

Instances details

Show RecastDestinationSize # |
Instance details Defined in Basement.Exception Methods showsPrec :: Int -> RecastDestinationSize -> ShowS # show :: RecastDestinationSize -> String # showList :: [RecastDestinationSize] -> ShowS #
Eq RecastDestinationSize # |
Instance details Defined in Basement.Exception Methods (==) :: RecastDestinationSize -> RecastDestinationSize -> Bool # (/=) :: RecastDestinationSize -> RecastDestinationSize -> Bool #

data NonEmptyCollectionIsEmpty #

Exception for using NonEmpty assertion with an empty collection

Constructors

NonEmptyCollectionIsEmpty |

#### Instances

Instances details

Exception NonEmptyCollectionIsEmpty # |
Instance details Defined in Basement.Exception Methods toException :: NonEmptyCollectionIsEmpty -> SomeException fromException :: SomeException -> Maybe NonEmptyCollectionIsEmpty displayException :: NonEmptyCollectionIsEmpty -> String
Show NonEmptyCollectionIsEmpty # |
Instance details Defined in Basement.Exception Methods showsPrec :: Int -> NonEmptyCollectionIsEmpty -> ShowS # show :: NonEmptyCollectionIsEmpty -> String # showList :: [NonEmptyCollectionIsEmpty] -> ShowS #