Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Dec 21, 2014
  1. @treeowl

    Add Applicative benchmarks

    treeowl authored
  2. @treeowl

    Reimplement `<*>`

    treeowl authored
    Use `coerce` for the `Functor` instance of `Elem`
    
    Using `fmap = coerce` for `Elem` speeds up `<*>` by somewhere
    around 20%.
    
    Benchmark results:
    
    OLD:
    
    benchmarking <*>/ix1000/500000
    time                 11.47 ms   (11.37 ms .. 11.59 ms)
                         0.999 R²   (0.998 R² .. 1.000 R²)
    mean                 11.61 ms   (11.52 ms .. 11.73 ms)
    std dev              279.9 μs   (209.5 μs .. 385.6 μs)
    
    benchmarking <*>/nf100/2500/rep
    time                 8.530 ms   (8.499 ms .. 8.568 ms)
                         1.000 R²   (1.000 R² .. 1.000 R²)
    mean                 8.511 ms   (8.498 ms .. 8.528 ms)
    std dev              40.40 μs   (28.55 μs .. 63.84 μs)
    
    benchmarking <*>/nf100/2500/ff
    time                 27.13 ms   (26.16 ms .. 28.70 ms)
                         0.994 R²   (0.988 R² .. 1.000 R²)
    mean                 26.49 ms   (26.29 ms .. 27.43 ms)
    std dev              697.1 μs   (153.0 μs .. 1.443 ms)
    
    benchmarking <*>/nf500/500/rep
    time                 8.421 ms   (8.331 ms .. 8.491 ms)
                         0.991 R²   (0.967 R² .. 1.000 R²)
    mean                 8.518 ms   (8.417 ms .. 9.003 ms)
    std dev              529.9 μs   (40.37 μs .. 1.176 ms)
    variance introduced by outliers: 32% (moderately inflated)
    
    benchmarking <*>/nf500/500/ff
    time                 33.71 ms   (33.58 ms .. 33.86 ms)
                         1.000 R²   (1.000 R² .. 1.000 R²)
    mean                 33.69 ms   (33.62 ms .. 33.76 ms)
    std dev              150.0 μs   (119.0 μs .. 191.0 μs)
    
    benchmarking <*>/nf2500/100/rep
    time                 8.390 ms   (8.259 ms .. 8.456 ms)
                         0.997 R²   (0.992 R² .. 1.000 R²)
    mean                 8.544 ms   (8.441 ms .. 8.798 ms)
    std dev              402.6 μs   (21.25 μs .. 714.9 μs)
    variance introduced by outliers: 23% (moderately inflated)
    
    benchmarking <*>/nf2500/100/ff
    time                 53.69 ms   (53.33 ms .. 54.08 ms)
                         1.000 R²   (1.000 R² .. 1.000 R²)
    mean                 53.59 ms   (53.38 ms .. 53.75 ms)
    std dev              341.2 μs   (231.7 μs .. 473.9 μs)
    
    NEW
    
    benchmarking <*>/ix1000/500000
    time                 2.688 μs   (2.607 μs .. 2.798 μs)
                         0.994 R²   (0.988 R² .. 1.000 R²)
    mean                 2.632 μs   (2.607 μs .. 2.715 μs)
    std dev              129.9 ns   (65.93 ns .. 242.8 ns)
    variance introduced by outliers: 64% (severely inflated)
    
    benchmarking <*>/nf100/2500/rep
    time                 8.371 ms   (8.064 ms .. 8.535 ms)
                         0.983 R²   (0.947 R² .. 1.000 R²)
    mean                 8.822 ms   (8.590 ms .. 9.463 ms)
    std dev              991.2 μs   (381.3 μs .. 1.809 ms)
    variance introduced by outliers: 61% (severely inflated)
    
    benchmarking <*>/nf100/2500/ff
    time                 22.84 ms   (22.74 ms .. 22.94 ms)
                         1.000 R²   (1.000 R² .. 1.000 R²)
    mean                 22.78 ms   (22.71 ms .. 22.86 ms)
    std dev              183.3 μs   (116.3 μs .. 291.3 μs)
    
    benchmarking <*>/nf500/500/rep
    time                 8.320 ms   (8.102 ms .. 8.514 ms)
                         0.995 R²   (0.990 R² .. 0.999 R²)
    mean                 8.902 ms   (8.675 ms .. 9.407 ms)
    std dev              952.4 μs   (435.5 μs .. 1.672 ms)
    variance introduced by outliers: 58% (severely inflated)
    
    benchmarking <*>/nf500/500/ff
    time                 24.50 ms   (24.41 ms .. 24.58 ms)
                         1.000 R²   (1.000 R² .. 1.000 R²)
    mean                 24.44 ms   (24.41 ms .. 24.48 ms)
    std dev              75.08 μs   (50.16 μs .. 111.3 μs)
    
    benchmarking <*>/nf2500/100/rep
    time                 8.419 ms   (8.366 ms .. 8.458 ms)
                         1.000 R²   (1.000 R² .. 1.000 R²)
    mean                 8.571 ms   (8.525 ms .. 8.670 ms)
    std dev              179.5 μs   (112.0 μs .. 278.1 μs)
    
    benchmarking <*>/nf2500/100/ff
    time                 24.14 ms   (24.07 ms .. 24.26 ms)
                         1.000 R²   (1.000 R² .. 1.000 R²)
    mean                 24.11 ms   (24.07 ms .. 24.17 ms)
    std dev              103.8 μs   (68.34 μs .. 142.0 μs)
Commits on Dec 20, 2014
  1. @foxik

    Merge pull request #107 from treeowl/fromListN

    foxik authored
    Use fromList2 to implement fromListN in IsList
  2. @foxik

    Merge pull request #102 from treeowl/validation

    foxik authored
    Add tests for Applicative and Monad instances
  3. @treeowl

    Remove CPP

    treeowl authored
  4. @treeowl

    Add tests for Applicative and Monad instances

    treeowl authored
    Unfortunately, these tests are rather slow, so I hid them behind
    a SLOW_TESTS macro. I don't know nearly enough about cabal to know
    how to arrange for tests to be run conditionally, so hopefully
    someone else can set that up properly.
Commits on Dec 19, 2014
  1. @foxik

    Merge pull request #108 from RossPaterson/master

    foxik authored
    Fix Arbitrary instance for FingerTree
  2. @RossPaterson

    Fix Arbitrary instance for FingerTree

    RossPaterson authored
    The previous version never generated deep trees containing Empty.
    Also tweaked the size handling so that the tree size is closer to the
    specified size (though it can still run over a bit).
  3. @treeowl
Commits on Dec 18, 2014
  1. @foxik

    Merge pull request #101 from treeowl/zipdocfix

    foxik authored
    Fix efficiency claim for zipWith.
  2. @treeowl
Commits on Dec 16, 2014
  1. @foxik

    Bump version number to 0.5.6.1

    foxik authored
  2. @foxik

    Add forgotten foldMap to the imports.

    foxik authored
    The foldMap is in Prelude on base 4.8, that is why I missed it.
  3. @foxik

    It is perfectly fine to import class methods...

    foxik authored
    ...without specifying the class, see Haskell 2010 5.2.1.
    That allows us to get rid of some conditional includes.
    
    Nevetheless, we still conditionally include foldr', as we do not
    use it for base <4.8.
  4. @foxik

    Import only used class methods of Foldable.

    foxik authored
    On GHC 7.8, the Foldable class contains also null and length, which
    conflicts with Data.Sequence{null,length}.
  5. @foxik

    Remove circular `toList` definition.

    foxik authored
    When writing this, I assumed we have explicit `toList` as we have in
    other containers. We do not have `toList`, and even if we did, the code
    would not compile, as the two `toList`s (ours and `Foldable`) would
    collide.
  6. @foxik
Commits on Dec 15, 2014
  1. @foxik

    Add the include dir also to tests.

    foxik authored
    This worked with Typeable because Typeable from `base` instead of
    `containers` was used.
  2. @foxik

    Nuke include/Typeable.h, create include/containers.h instead.

    foxik authored
    The "Typeable.h" collides with the header of same name in base.
    
    The new "containers.h" is now used in every Haskell source.
    It contains more stuff used across the containers codebase:
    - INSTANCE_TYPEABLE[0-2] (was in Typeable.h)
    - include MachDeps on __GLASGOW_HASKELL__ to define WORD_SIZE_IN_BITS
    - define STRICT_x_OF_y macros
    - define MIN_VERSION_base if not defined by cabal (during cabal-less build)
  3. @foxik

    Fix warnings.

    foxik authored
    In getNodes, pass (a, [a]) instead of an [a] which we know is nonempty.
    This way we do not have to create void pattern-match case for empty
    list.
    
    Also use STRICT_x_OF_y macros instead of `seq`-ing in every
    pattern-match case.
  4. @foxik

    Merge pull request #97 from treeowl/add-credit

    foxik authored
    Add Ross Paterson to 2014 copyright statement
  5. @treeowl

    Add Ross Paterson to 2014 copyright statement

    treeowl authored
    He wrote the first draft of the new `fromList` code.
  6. @tibbe

    Bump version number to 0.5.6.0

    tibbe authored
  7. @foxik

    Add Data.Sequence.fromArray.

    foxik authored
    Sugested by David Feuer in #88.
    
    The implementation on GHC uses GHC.Arr module and is considerably faster
    than on non-GHC compilers.
  8. @foxik
  9. @foxik
  10. @foxik

    Remove trailing whitespace.

    foxik authored
  11. @treeowl @foxik

    Use a top-down version of fromList

    treeowl authored foxik committed
    Ross Paterson came up with a version of fromList that avoids the
    tree rebuilding inherent in the `(|>)`-based approach. This
    version is somewhat strictified and rearranged. It reduces
    allocation substantially over the old version. Mutator time goes
    down too, but for some reason GC time rises to match it.
  12. @foxik
  13. @foxik

    Remove unsafeCoerce, use only coerce on GHC 7.8 and later.

    foxik authored
    Also, move the conditional compilation to a local where definition.
    
    On my GHC 7.6.3, there is no heap allocation in the cmm in fromFunction
    for the (Elem . f) closure, so there is no penalty of not using `coerce`.
    Nevertheless, GHC 7.8.3 and GHC-head (15 Dec 2014) do heap-allocate
    trivial closure for (Elem . f), so `coerce` helps.
    
    Back to GHC 7.6.3, I found that the following does not allocate in
    GHC 7.6.3:
      newtype Elem a = Elem a
      elemMap :: Int -> (Int -> b) -> [Elem b]
      elemMap s f = go (Elem . f) 0
       where go :: (Int -> b) -> Int -> [b]
             go f i | i >= s = []
                    | otherwise = f i : go f (i+1)
    Nevertheless, the following does heap-allocate trivial closure for f:
      newtype Elem a = Elem a
      elemMap :: [Int] -> (Int -> b) -> [Elem b]
      elemMap xs f = go (Elem . f) xs
       where go :: (Int -> b) -> [Int] -> [b]
             go f [] = []
             go f (x:xs) = f x : go f xs
    I am not sure what the difference is, but the current fromFunction
    does not allocate too (on 7.6.3).
  14. @foxik
  15. @foxik
  16. @foxik

    Fix warnings.

    foxik authored
Commits on Dec 14, 2014
  1. @foxik

    Add test for fromFunction.

    foxik authored
  2. @foxik
Something went wrong with that request. Please try again.