| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.RandomAccessList.Class
Synopsis
- class RandomAccessList e where
- head :: (RandomAccessList e, a ~ Element e) => e -> a
- tail :: RandomAccessList e => e -> e
- newtype AsRAL a = AsRAL a
Documentation
class RandomAccessList e where #
Typeclass for various types implementing the "signature" of a random-access list.
A true random-access list should have good asymptotic behaviour for these methods also, but for convenience we also provide implementations for e.g. '[a]', which has bad lookup performance.
Associated Types
type Element e :: NonEmptyVector (Element e) -> e -> e #
Prepend many elements to the list. Has a default implementation, but implementations can provide more efficient ones.
indexZero :: e -> NonEmptyVector (Element [a]) -> [a] -> [a] #
indexZero :: [a] -> Word64 -> Maybe (Element [a]) #
indexOne :: [a] -> Word64 -> Maybe (Element [a]) #
unsafeIndexZero :: [a] -> Word64 -> Element [a] #
unsafeIndexOne :: [a] -> Word64 -> Element [a] #
head :: (RandomAccessList e, a ~ Element e) => e -> a #
tail :: RandomAccessList e => e -> e #
Constructors
| AsRAL a |
Instances
| RandomAccessList e => IsList (AsRAL e) # | |
| type Item (AsRAL e) # | |
Defined in Data.RandomAccessList.Class | |