read -package:base-prelude -package:HsOpenSSL package:vector

Yield the element at the given position. Will throw an exception if the index is out of range.

Examples

>>> import qualified Data.Vector.Mutable as MV

>>> v <- MV.generate 10 (\x -> x*x)

>>> MV.read v 3
9
Yield the element at the given position. Will throw an exception if the index is out of range.

Examples

>>> import qualified Data.Vector.Mutable as MV

>>> v <- MV.generate 10 (\x -> x*x)

>>> MV.read v 3
9
Yield the element at the given position. Will throw an exception if the index is out of range.

Examples

>>> import qualified Data.Vector.Primitive.Mutable as MVP

>>> v <- MVP.generate 10 (\x -> x*x)

>>> MVP.read v 3
9
Yield the element at the given position. Will throw an exception if the index is out of range.

Examples

>>> import qualified Data.Vector.Storable.Mutable as MVS

>>> v <- MVS.generate 10 (\x -> x*x)

>>> MVS.read v 3
9
Yield the element at the given position. Will throw an exception if the index is out of range.

Examples

>>> import qualified Data.Vector.Unboxed.Mutable as MVU

>>> v <- MVU.generate 10 (\x -> x*x)

>>> MVU.read v 3
9
Generic definition of readPrec.
Yield the element at the given position. Returns Nothing if the index is out of range.

Examples

>>> import qualified Data.Vector.Mutable as MV

>>> v <- MV.generate 10 (\x -> x*x)

>>> MV.readMaybe v 3
Just 9

>>> MV.readMaybe v 13
Nothing
Yield the element at the given position. Returns Nothing if the index is out of range.

Examples

>>> import qualified Data.Vector.Mutable as MV

>>> v <- MV.generate 10 (\x -> x*x)

>>> MV.readMaybe v 3
Just 9

>>> MV.readMaybe v 13
Nothing
Yield the element at the given position. Returns Nothing if the index is out of range.

Examples

>>> import qualified Data.Vector.Primitive.Mutable as MVP

>>> v <- MVP.generate 10 (\x -> x*x)

>>> MVP.readMaybe v 3
Just 9

>>> MVP.readMaybe v 13
Nothing
Yield the element at the given position. Returns Nothing if the index is out of range.

Examples

>>> import qualified Data.Vector.Storable.Mutable as MVS

>>> v <- MVS.generate 10 (\x -> x*x)

>>> MVS.readMaybe v 3
Just 9

>>> MVS.readMaybe v 13
Nothing
Yield the element at the given position. Returns Nothing if the index is out of range.

Examples

>>> import qualified Data.Vector.Unboxed.Mutable as MVU

>>> v <- MVU.generate 10 (\x -> x*x)

>>> MVU.readMaybe v 3
Just 9

>>> MVU.readMaybe v 13
Nothing
Note: uses ReadS.
Yield the element at the given position. This method should not be called directly, use unsafeRead instead.
Yield the element at the given position. No bounds checks are performed.
Yield the element at the given position. No bounds checks are performed.
Yield the element at the given position. No bounds checks are performed.
Yield the element at the given position. No bounds checks are performed.
Yield the element at the given position. No bounds checks are performed.