:: Ord a => [a] -> f a
Coerce while preserving the type index.
Given a
Lift n constraint in a signature carried by
m,
sendM promotes arbitrary actions of type
n
a to
m a. It is spiritually similar to
lift
from the
MonadTrans typeclass.
Pick a random element of the list.
O(n) Convert a list to a vector. During the operation, the
vector’s capacity will be doubling until the list's contents are in
the vector. Depending on the list’s size, up to half of the vector’s
capacity might be empty. If you’d rather avoid this, you can use
fromListN, which will provide the exact space the list requires
but will prevent list fusion, or
force .
fromList, which will create the vector and then copy it
without the superfluous space.
O(n) Convert a list to a vector
Create vector form list. Will throw error if list is shorter than
resulting vector.
Create vector form list. Will throw error if list has different length
from resulting vector.
maximum returns the maximum value from a list, which must be
non-empty, finite, and of an ordered type. It is a special case of
maximumBy, which allows the programmer to supply their own
comparison function. Empty lists throw an
EmptyListException.
minimum returns the maximum value from a list, which must be
non-empty, finite, and of an ordered type. It is a special case of
minimumBy, which allows the programmer to supply their own
comparison function. Empty lists throw an
EmptyListException.
Convert a prim monad to another prim monad.
The net effect is that it coerce the state repr to another, so the
runtime representation should be the same, otherwise hilary ensues.
O(n) Convert between different vector types.
O(n) Convert different vector types
Tail of vector.
Examples:
>>> import Data.Complex
>>> tail (1,2,3) :: Complex Double
2.0 :+ 3.0
Convert between different vector types
O(1) First element of a vector in a monad. See
indexM
for an explanation of why this is useful.
O(1) Last element of a vector in a monad. See
indexM for
an explanation of why this is useful.
O(1) First element in a monad, without checking for empty
vectors. See
indexM for an explanation of why this is useful.
O(1) Last element in a monad, without checking for empty
vectors. See
indexM for an explanation of why this is useful.
O(1) First element in a monad without checking for empty
vectors. See
indexM for an explanation of why this is useful.