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.

  1. fromListN :: IsList l => Int -> [Item l] -> l

    base-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
    

  2. fromList' :: Vector v a => [a] -> v a

    fixed-vector Data.Vector.Fixed

    Create vector form list. Will throw error if list has different length from resulting vector.

  3. 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.

  4. fromList' :: forall (n :: PeanoNum) a . ArityPeano n => [a] -> ContVec n a

    fixed-vector Data.Vector.Fixed.Cont

    Same as fromList bu throws error is list doesn't have same length as vector.

  5. 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.

  6. fromListWith :: (Ord k, MonoidNull v) => (v -> v -> v) -> [(k, v)] -> MonoidMap k v

    monoidmap 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))
    

  7. 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
    

  8. fromListUnboxed :: (Shape sh, Unbox a) => sh -> [a] -> Array U sh a

    repa Data.Array.Repa

    O(n). Convert a list to an unboxed vector array.

    • This is an alias for fromList with a more specific type.

  9. fromListUnboxed :: (Shape sh, Unbox a) => sh -> [a] -> Array U sh a

    repa 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.

  10. fromListVector :: Shape sh => sh -> [a] -> Array V sh a

    repa 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.

Page 52 of many | Previous | Next