Hoogle Search

Within LTS Haskell 24.60 (ghc-9.10.3)

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

  1. fromDistinctAscList :: [Key] -> IntSet

    containers Data.IntSet.Internal

    Build a set from an ascending list of distinct elements. The precondition (input list is strictly ascending) is not checked.

  2. fromList :: [Key] -> IntSet

    containers Data.IntSet.Internal

    Create a set from a list of integers.

  3. toAscList :: IntSet -> [Key]

    containers Data.IntSet.Internal

    Convert the set to an ascending list of elements. Subject to list fusion.

  4. toDescList :: IntSet -> [Key]

    containers Data.IntSet.Internal

    Convert the set to a descending list of elements. Subject to list fusion.

  5. toList :: IntSet -> [Key]

    containers Data.IntSet.Internal

    Convert the set to a list of elements. Subject to list fusion.

  6. fromAscList :: Eq k => [(k, a)] -> Map k a

    containers Data.Map.Internal

    Build a map from an ascending list in linear time. The precondition (input list is ascending) is not checked.

    fromAscList [(3,"b"), (5,"a")]          == fromList [(3, "b"), (5, "a")]
    fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
    valid (fromAscList [(3,"b"), (5,"a"), (5,"b")]) == True
    valid (fromAscList [(5,"a"), (3,"b"), (5,"b")]) == False
    

  7. fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a

    containers Data.Map.Internal

    Build a map from an ascending list in linear time with a combining function for equal keys. The precondition (input list is ascending) is not checked.

    fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
    valid (fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")]) == True
    valid (fromAscListWith (++) [(5,"a"), (3,"b"), (5,"b")]) == False
    

  8. fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a

    containers Data.Map.Internal

    Build a map from an ascending list in linear time with a combining function for equal keys. The precondition (input list is ascending) is not checked.

    let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2
    fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")] == fromList [(3, "b"), (5, "5:b5:ba")]
    valid (fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")]) == True
    valid (fromAscListWithKey f [(5,"a"), (3,"b"), (5,"b"), (5,"b")]) == False
    
    Also see the performance note on fromListWith.

  9. fromDescList :: Eq k => [(k, a)] -> Map k a

    containers Data.Map.Internal

    Build a map from a descending list in linear time. The precondition (input list is descending) is not checked.

    fromDescList [(5,"a"), (3,"b")]          == fromList [(3, "b"), (5, "a")]
    fromDescList [(5,"a"), (5,"b"), (3,"b")] == fromList [(3, "b"), (5, "b")]
    valid (fromDescList [(5,"a"), (5,"b"), (3,"b")]) == True
    valid (fromDescList [(5,"a"), (3,"b"), (5,"b")]) == False
    

  10. fromDescListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a

    containers Data.Map.Internal

    Build a map from a descending list in linear time with a combining function for equal keys. The precondition (input list is descending) is not checked.

    fromDescListWith (++) [(5,"a"), (5,"b"), (3,"b")] == fromList [(3, "b"), (5, "ba")]
    valid (fromDescListWith (++) [(5,"a"), (5,"b"), (3,"b")]) == True
    valid (fromDescListWith (++) [(5,"a"), (3,"b"), (5,"b")]) == False
    
    Also see the performance note on fromListWith.

Page 39 of many | Previous | Next