Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
HaskellWorks.Data.AtIndex
Synopsis
- class Container a where
- type Elem a
- class Length v => AtIndex v where
- class Container v => Length v where
- atIndexOr :: AtIndex v => Elem v -> v -> Position -> Elem v
- atIndexOrBeforeOrAfter :: AtIndex v => Elem v -> Elem v -> v -> Position -> Elem v
- atIndexOrBeforeOrLast :: (AtIndex v, Length v) => Elem v -> v -> Position -> Elem v
Documentation
Instances
class Length v => AtIndex v where #
Instances
AtIndex ByteString # | |
AtIndex (Vector Int16) # | |
AtIndex (Vector Int32) # | |
AtIndex (Vector Int64) # | |
AtIndex (Vector Int8) # | |
AtIndex (Vector Word16) # | |
AtIndex (Vector Word32) # | |
AtIndex (Vector Word64) # | |
AtIndex (Vector Word8) # | |
AtIndex (Vector Int16) # | |
AtIndex (Vector Int32) # | |
AtIndex (Vector Int64) # | |
AtIndex (Vector Int8) # | |
AtIndex (Vector Word16) # | |
AtIndex (Vector Word32) # | |
AtIndex (Vector Word64) # | |
AtIndex (Vector Word8) # | |
AtIndex (Vector Int) # | |
AtIndex [a] # | |
class Container v => Length v where #
Minimal complete definition
Instances
Length ByteString # | |
Length (Vector Int16) # | |
Length (Vector Int32) # | |
Length (Vector Int64) # | |
Length (Vector Int8) # | |
Length (Vector Word16) # | |
Length (Vector Word32) # | |
Length (Vector Word64) # | |
Length (Vector Word8) # | |
Length (Vector Int16) # | |
Length (Vector Int32) # | |
Length (Vector Int64) # | |
Length (Vector Int8) # | |
Length (Vector Word16) # | |
Length (Vector Word32) # | |
Length (Vector Word64) # | |
Length (Vector Word8) # | |
Length (Vector Int) # | |
Length [a] # | |
atIndexOr :: AtIndex v => Elem v -> v -> Position -> Elem v #
Get the element of the container at the specified position, but return d
if position
is out of bounds.
atIndexOrBeforeOrAfter :: AtIndex v => Elem v -> Elem v -> v -> Position -> Elem v #
Get the element of the container at the specified position, but return before
if position
before the first element or after
if the position is beyond the last element.
atIndexOrBeforeOrLast :: (AtIndex v, Length v) => Elem v -> v -> Position -> Elem v #
Get the element of the container at the specified position, but return the last element
if the position is past the end of the container or the default value before'
if the position
is before the beginning of the vector.
In the case when the container is empty, then the default value before'
is used.