HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulehw-prim-0.6.3.2Haskell2010

HaskellWorks.Data.AtIndex

Synopsis
  • 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, …
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.