Hoogle Search

Within LTS Haskell 24.3 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. fromListWith :: Enum k => (a -> a -> a) -> [(k, a)] -> EnumMap k a

    enummapset Data.EnumMap.Strict

    No documentation available.

  2. fromListWithKey :: Enum k => (k -> a -> a -> a) -> [(k, a)] -> EnumMap k a

    enummapset Data.EnumMap.Strict

    No documentation available.

  3. fromLists' :: forall r ix e . (HasCallStack, Ragged L ix e, Manifest r e) => Comp -> [ListItem ix e] -> Array r ix e

    massiv Data.Massiv.Array

    Same as fromListsM, but will throw an error on irregular shaped lists. Note: This function is the same as if you would turn on {-# LANGUAGE OverloadedLists #-} extension. For that reason you can also use fromList.

    \xs -> fromLists' Seq xs == (fromList Seq xs :: Vector P Int)
    

    Examples

    Convert a list of lists into a 2D Array
    >>> import Data.Massiv.Array as A
    
    >>> fromLists' Seq [[1,2,3],[4,5,6]] :: Array U Ix2 Int
    Array U Seq (Sz (2 :. 3))
    [ [ 1, 2, 3 ]
    , [ 4, 5, 6 ]
    ]
    
    Above example implemented using GHC's OverloadedLists extension:
    >>> :set -XOverloadedLists
    
    >>> [[1,2,3],[4,5,6]] :: Array U Ix2 Int
    Array U Seq (Sz (2 :. 3))
    [ [ 1, 2, 3 ]
    , [ 4, 5, 6 ]
    ]
    

  4. fromListsM :: forall r ix e m . (Ragged L ix e, Manifest r e, MonadThrow m) => Comp -> [ListItem ix e] -> m (Array r ix e)

    massiv Data.Massiv.Array

    O(n) - Convert a nested list into an array. Nested list must be of a rectangular shape, otherwise a runtime error will occur. Also, nestedness must match the rank of resulting array, which should be specified through an explicit type signature.

    Examples

    >>> import Data.Massiv.Array as A
    
    >>> fromListsM Seq [[1,2,3],[4,5,6]] :: Maybe (Array U Ix2 Int)
    Just (Array U Seq (Sz (2 :. 3))
    [ [ 1, 2, 3 ]
    , [ 4, 5, 6 ]
    ]
    )
    
    >>> fromListsM Par [[[1,2,3]],[[4,5,6]]] :: Maybe (Array U Ix3 Int)
    Just (Array U Par (Sz (2 :> 1 :. 3))
    [ [ [ 1, 2, 3 ]
    ]
    , [ [ 4, 5, 6 ]
    ]
    ]
    )
    
    Elements of a boxed array could be lists themselves if necessary, but cannot be ragged:
    >>> fromListsM Seq [[[1,2,3]],[[4,5]]] :: Maybe (Array B Ix2 [Int])
    Just (Array B Seq (Sz (2 :. 1))
    [ [ [1,2,3] ]
    , [ [4,5] ]
    ]
    )
    
    >>> fromListsM Seq [[[1,2,3]],[[4,5]]] :: Maybe (Array B Ix3 Integer)
    Nothing
    
    >>> fromListsM Seq [[[1,2,3]],[[4,5,6],[7,8,9]]] :: IO (Array B Ix3 Integer)
    *** Exception: DimTooLongException for (Dim 2): expected (Sz1 1), got (Sz1 2)
    
    >>> fromListsM Seq [[1,2,3,4],[5,6,7]] :: IO (Matrix B Integer)
    *** Exception: DimTooShortException for (Dim 1): expected (Sz1 4), got (Sz1 3)
    

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

    ghc-internal GHC.Internal.Exts

    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
    

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

    ghc-internal GHC.Internal.IsList

    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
    

  7. fromListIO :: forall (m :: MutabilityType Type) . [JSVal] -> JSM (SomeJSArray m)

    jsaddle JavaScript.Array

    No documentation available.

  8. fromListIO :: forall (m :: MutabilityType Type) . [JSVal] -> JSM (SomeJSArray m)

    jsaddle JavaScript.Array.Internal

    No documentation available.

  9. fromListIO :: forall (m :: MutabilityType Type) . [JSVal] -> JSM (SomeJSArray m)

    jsaddle Language.Javascript.JSaddle.Object

    No documentation available.

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

    numhask NumHask.Prelude

    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
    

Page 46 of many | Previous | Next