Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/haskell/containers. Pull mirroring updated .
  1. Mar 01, 2025
  2. Feb 28, 2025
  3. Feb 25, 2025
    • meooow's avatar
      Improve module Haddocks (#1115) · 35916352
      meooow authored
      * Make module Haddocks largely consistent across Set, Map, IntSet,
        IntMap, Seq.
      * Make public module docs for each structure (e.g. Data.Map,
        Data.Map.Lazy, Data.Map.Strict) have similar structure and content.
        This means some duplication of text, but there is no way to avoid it.
      * Trim down internal module Haddocks (e.g. Data.Map.Internal) to a
        structure description and references. There is no need to repeat
        everything that's in the public module.
      * Add a few lines about the complexity of common operations on each set
        and map structure. In particular, union and intersection are mentioned
        with a clear description of 'm' and 'n', to reduce the chances that a
        reader assumes them to be tied to positions and not sizes.
      35916352
    • meooow's avatar
      Some additions to Data.Tree (#1109) · 6ead7869
      meooow authored
      Add some useful definitions to Data.Tree: leaves, edges, pathsToRoot,
      pathsFromRoot, PostOrder.
      6ead7869
  4. Feb 24, 2025
  5. Feb 23, 2025
  6. Feb 22, 2025
  7. Feb 16, 2025
  8. Feb 15, 2025
  9. Jan 30, 2025
  10. Jan 26, 2025
    • meooow's avatar
      Fix the ReadTheDocs setup (#1099) · a9e02973
      meooow authored
      * Fix Sphinx and sphinx-rtd-theme versions and update the code to make
        it work.
      * Use sphinx-rtd-theme instead of alabaster. This makes the appearance
        consistent with GHC and Cabal RTD.
      a9e02973
  11. Jan 25, 2025
  12. Jan 19, 2025
  13. Jan 18, 2025
  14. Jan 13, 2025
  15. Jan 12, 2025
    • meooow's avatar
      Inline the common case of balance functions (#1056) · d5cbecfc
      meooow authored
      For Set and Map, inline the common case of balance, balanceL, balanceR,
      as explained in the "Inlining balance" note.
      
      A decrease in running time of 10-30% is seen in benchmarks for insert,
      delete, union, and others.
      d5cbecfc
  16. Jan 11, 2025
    • Jonathan Knowles's avatar
      Improve documentation grammar and usage (#1088) · 9cc03bee
      Jonathan Knowles authored
      * In docs, use "look up" instead of "lookup" when used as a verb.
      
      "To look up (a thing)" is a phrasal verb, whereas the single word
      "lookup" (written without spaces) is generally used as a noun (for
      example: "in order to avoid an expensive lookup") and occasionally
      as an adjective (for example: "a lookup table").
      
      Some parts of the documentation already use "look up" in a verbal
      context.
      
      For example, `Data.Map.Internal.hs:1295` models correct usage:
      
      ```hs
      -- Look up a key and return a result indicating whether it was found
      -- and what path was taken.
      lookupTrace :: Ord k => k -> Map k a -> TraceResult a
      ```
      
      This commit adjusts the rest of the documentation (and comments) to
      match this usage (when "look up" is used as a verb). When "lookup"
      is used as a noun or an adjective, we leave it alone.
      
      This usage of phrasal verbs is similar to:
      
      - "pick up"  (verb) vs "pickup"  (noun)
      - "sit up"   (verb) vs "situp"   (noun)
      - "log in"   (verb) vs "login"   (noun)
      - "start up" (verb) vs "startup" (noun)
      - "set up"   (verb) vs "setup"   (noun)
      
      * In docs, insert the word "the" where it is missing.
      
      This commit also replaces "the" with "this" for consistency with
      documentation for other functions.
      9cc03bee
  17. Jan 10, 2025
  18. Jan 05, 2025
    • meooow's avatar
      Build Set and Map more efficiently and consistently (#1042) · 32c80d83
      meooow authored
      Use "Builder"s to implement some Set and Map construction functions.
      As a result, some have become good consumers in terms of list fusion,
      and all are now O(n) for non-decreasing input.
      
                           Fusible  Fusible  O(n) for     O(n) for
                           before   after    before       after
      
      Set.fromList         No       Yes      Strict incr  Non-decr
      Set.map              -        -        Strict incr  Non-decr
      Map.fromList         No       Yes      Strict incr  Non-decr
      Map.fromListWith     Yes      Yes      Never        Non-decr
      Map.fromListWithKey  Yes      Yes      Never        Non-decr
      Map.mapKeys          -        -        Strict incr  Non-decr
      Map.mapKeysWith      -        -        Never        Non-decr
      32c80d83
  19. Jan 04, 2025
    • dbeacham's avatar
      NFData1, NFData2 instances (#992) · dcafd78b
      dbeacham authored
      dcafd78b
    • meooow's avatar
      Improve fromAscList and friends for Set and Map (#1083) · dfeed8b0
      meooow authored
      * Make fromAscList, fromAscListWith, fromAscListWithKey, fromDescList,
        fromDescListWith, fromDescListWithKey more efficient by removing the
        intermediate list and making them good consumers in list fusion.
      * Update Set's fromAscList and fromDescList to keep the last of
        duplicates. This makes it consistent with all other fromList functions
        on Set and Map.
      * Update fromDistinct{Asc,Desc}List to take 1 arg for consistent
        inlining behavior.
      dfeed8b0
    • lennart@augustsson.net's avatar
      Update MicroHs version (#1081) · 2776ace6
      lennart@augustsson.net authored
      MicroHs has pattern synonyms now.
      Also, update CI to use mcabal for building the package.
      2776ace6
    • meooow's avatar
      Improve folds over bits for IntSet (#1079) · 06761b18
      meooow authored
      * Make foldr and foldl short-circuit instead of lazily accumulating
        thunks.
      * Switch to a non-empty style to avoid unnecessary comparisons. This
        also helps GHC with arity analysis (somehow), which greatly improves
        performance of CPS-style foldr and foldl.
      * Change the bitwise operations used from
        bitmask = bm .&. -bm; bi = ctz bitmask; bm' = bm `xor` bitmask
        to
        bi = ctz bm; bm' = bm .&. (bm-1)
        which is slightly faster.
      06761b18
  20. Dec 21, 2024
  21. Dec 20, 2024
  22. Dec 14, 2024
    • meooow's avatar
      Use randomly structured Set and Map in benchmarks (#1075) · b0b2cb51
      meooow authored
      Trees constructed from [1..n] have a specific structure of perfect
      binary trees linked together. We shuffle the list so that the tree
      is generated from repeated insertions instead, which forms a random
      structure that should be more representative of average use cases.
      
      Most benchmarks show an increase in measured times, the amount varying
      from 10% to 70%. This is expected because the trees are more unbalanced
      now. A handful of benchmarks show larger increases. These were previously
      measuring best-case scenarios, which no longer occur with random trees.
      b0b2cb51
  23. Dec 05, 2024
  24. Nov 30, 2024
Loading