hw-prim-0.6.2.13: Primitive functions and data types

Synopsis

# Documentation

class Container a Source #

Associated Types

type Elem a Source #

Instances

class Length v => AtIndex v where Source #

Minimal complete definition

Methods

(!!!) :: v -> Position -> Elem v Source #

atIndex :: v -> Position -> Elem v Source #

Instances

class Container v => Length v where Source #

Minimal complete definition

length

Methods

length :: v -> Count Source #

end :: v -> Position Source #

Instances
Get the element of the container at the specified position, but return d if position is out of bounds.
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.
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.