Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromListN :: IsList l => Int -> [Item l] -> lbase-prelude BasePrelude The fromListN function takes the input list's length and potentially uses it to construct the structure l more efficiently compared to fromList. If the given number does not equal to the input list's length the behaviour of fromListN is not specified.
fromListN (length xs) xs == fromList xs
fromList' :: Vector v a => [a] -> v afixed-vector Data.Vector.Fixed Create vector form list. Will throw error if list has different length from resulting vector.
fromListM :: Vector v a => [a] -> Maybe (v a)fixed-vector Data.Vector.Fixed Create vector form list. Will return Nothing if list has different length from resulting vector.
fromList' :: forall (n :: PeanoNum) a . ArityPeano n => [a] -> ContVec n afixed-vector Data.Vector.Fixed.Cont Same as fromList bu throws error is list doesn't have same length as vector.
fromListM :: forall (n :: PeanoNum) a . ArityPeano n => [a] -> Maybe (ContVec n a)fixed-vector Data.Vector.Fixed.Cont Convert list to continuation-based vector. Will fail with Nothing if list doesn't have right length.
fromListWith :: (Ord k, MonoidNull v) => (v -> v -> v) -> [(k, v)] -> MonoidMap k vmonoidmap Data.MonoidMap Constructs a MonoidMap from a list of key-value pairs, with a combining function for values. If the list contains more than one value for the same key, values are combined together in the order that they appear with the given combining function. Satisfies the following property for all possible keys k:
get k (fromListWith f kvs) == maybe mempty (foldl1 f) (nonEmpty (snd <$> filter ((== k) . fst) kvs))
fromListN :: Int -> [a] -> Maybe (NonEmptyVector a)nonempty-vector Data.Vector.NonEmpty O(n) Convert the first n elements of a list to a non-empty vector. If the list is empty or <= 0 elements are chosen, Nothing is returned, otherwise Just containing the non-empty vector
>>> fromListN 3 [1..5] Just [1,2,3]
>>> fromListN 3 [] Nothing
>>> fromListN 0 [1..5] Nothing
fromListUnboxed :: (Shape sh, Unbox a) => sh -> [a] -> Array U sh arepa Data.Array.Repa O(n). Convert a list to an unboxed vector array.
- This is an alias for fromList with a more specific type.
fromListUnboxed :: (Shape sh, Unbox a) => sh -> [a] -> Array U sh arepa Data.Array.Repa.Repr.Unboxed O(n). Convert a list to an unboxed vector array.
- This is an alias for fromList with a more specific type.
fromListVector :: Shape sh => sh -> [a] -> Array V sh arepa Data.Array.Repa.Repr.Vector O(n). Convert a list to a boxed vector array.
- This is an alias for fromList with a more specific type.