The index must be smaller than the length of the list, otherwise the result is undefined.
Modulenumeric-prelude-0.4.4Haskell98
NumericPrelude.List.Generic
Functions that are counterparts of the generic functions in Data.List
using NumericPrelude.Numeric type classes.
For input arguments we use the restrictive ToInteger constraint,
although in principle RealRing would be enough.
However we think that take 0.5 xs is rather a bug than a feature,
thus we forbid fractional types.
On the other hand fractional types as result can be quite handy,
e.g. in average xs = sum xs / length xs.
Synopsis
- value !!
- value lengthLeft
- value lengthRight
- value replicate
- value take
- value drop
- value splitAt
- value findIndex
- value elemIndex
- value findIndices
- value elemIndices
- Packagenumeric-prelude-0.4.4
- Exports11
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceGeneric.hs
Left associative length computation
that is appropriate for types like Integer.
Right associative length computation
that is appropriate for types like Peano number.