HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulehw-prim-0.6.3.2Haskell2010

HaskellWorks.Data.AtIndex

  • 3 classes
  • 3 values
  • Packagehw-prim-0.6.3.2
  • Exports6
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceAtIndex.hs
classclass Container a where
#

Associated types

Instances19Container, …
classclass Length v => AtIndex v where
#

Methods

Instances19AtIndex, …
classclass Container v => Length v where
#

Methods

Instances19Length, …
valueatIndexOr :: 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.

valueatIndexOrBeforeOrAfter
  1. :: AtIndex v
  2. => Elem v
  3. -> Elem v
  4. -> v
  5. -> Position
  6. -> 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.

valueatIndexOrBeforeOrLast
  1. :: (AtIndex v, Length v)
  2. => Elem v
  3. -> v
  4. -> Position
  5. -> 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.