This project is mirrored from https://github.com/kolmodin/binary. Pull mirroring updated .
  1. 04 Jul, 2019 1 commit
  2. 29 Jun, 2019 1 commit
  3. 11 Mar, 2019 1 commit
    • Alec Theriault's avatar
      Haddock markup fixes · 722622d8
      Alec Theriault authored
        * Use the standard `@since` notation (since it plays well with
          re-exports in other packages)
        * Use `@ ... @` for monospacing things that aren't identifiers
        * Qualify some linked identifiers (so that they actually link)
      722622d8
  4. 02 Feb, 2019 1 commit
  5. 20 Jan, 2019 1 commit
  6. 08 Nov, 2018 1 commit
  7. 05 Nov, 2018 1 commit
  8. 04 Oct, 2018 1 commit
  9. 10 Aug, 2018 1 commit
  10. 12 Mar, 2018 1 commit
  11. 02 Apr, 2017 1 commit
  12. 13 Mar, 2017 1 commit
  13. 03 Mar, 2017 1 commit
  14. 25 Feb, 2017 1 commit
  15. 15 May, 2016 1 commit
  16. 11 May, 2016 1 commit
  17. 01 May, 2016 1 commit
  18. 16 Apr, 2016 1 commit
  19. 07 Apr, 2016 1 commit
  20. 04 Apr, 2016 1 commit
    • Lennart Kolmodin's avatar
      Add 'putList' instance for Word8. · d87fd415
      Lennart Kolmodin authored
      Highlights from the benchmarks;
        "big Integers"                                         :      5850.12 us        3841.54 us      -34.3%
        "[big Integer]"                                        :      6074.67 us        3959.01 us      -34.8%
        Word8s                                                 :       256.19 us         266.92 us      +4.2%
        [Word8]                                                :       283.39 us          67.59 us      -76.2%
      d87fd415
  21. 03 Apr, 2016 3 commits
    • Lennart Kolmodin's avatar
      Document 'putList'. · fbef3cb8
      Lennart Kolmodin authored
      fbef3cb8
    • Lennart Kolmodin's avatar
      Add 'putList' instance for Char. · bb745064
      Lennart Kolmodin authored
      This speeds up the UTF8 encoding of String with about 70%.
      
      The small String benchmark;
        "small Strings"  :      3459.04 us        1037.00 us      -70.0%
      
      GenericsBench bechmark encodes a data type with many Strings;
        encode           :     46391.59 us       13116.85 us      -71.7%
      bb745064
    • Lennart Kolmodin's avatar
      Extend the Binary class with 'putList :: [a] -> Put' · dd1f8953
      Lennart Kolmodin authored
      The default implementation of the new class function is the same as
      'instance Binary a => Binary [a]' used to be.
      
      'putList' will enable users to define their own serialization for lists of
      types. We'll use this to give new list serialization implementations for types
      already defined in binary.
      dd1f8953
  22. 02 Apr, 2016 1 commit
  23. 15 Mar, 2016 1 commit
  24. 06 Mar, 2016 1 commit
    • Lennart Kolmodin's avatar
      Fail rather than throw exception when decoding Bool and Ordering · 29914028
      Lennart Kolmodin authored
      Decoding Bool and Ordering was not graceful in case of invalid input.
      Trying to decode (2 :: Word8) to a Bool would throw an exception
      in GHC.Enum.toEnum as only the values 0 and 1 are defined.
      
      We work around that in this patch by not using toEnum. In case
      of unexpected input, we fail using 'fail'.
      
      This fixes #108.
      29914028
  25. 26 Jan, 2016 1 commit
  26. 23 Jan, 2016 1 commit
  27. 19 Dec, 2015 1 commit
  28. 18 Dec, 2015 1 commit
    • Edward Z. Yang's avatar
      Split GBinary into GBinaryGet and GBinaryPut, speeds up compilation. · c641061f
      Edward Z. Yang authored
      Consider:
      
          {-# LANGUAGE DeriveGeneric #-}
          module A where
          import Data.Binary
          import GHC.Generics
          data T = T
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           () () () () () () () () () ()
           deriving Generic
          instance Binary T
      
      Without this patch, on GHC 7.10.2, building this -O2 takes 6.7s.  With
      this patch, it takes 1.7s.  Amazing.  (There are modest improvements
      with other versions of GHC too.)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      c641061f
  29. 13 Nov, 2015 1 commit
  30. 12 Nov, 2015 1 commit
  31. 11 Nov, 2015 2 commits
  32. 23 Oct, 2015 1 commit
    • Brian McKenna's avatar
      Add Binary Void instance · 57cf1f04
      Brian McKenna authored
      This is so that we can write and read things like [Void], or (Expr Void)
      - something I'm actually doing in Morte.
      
      https://github.com/Gabriel439/Haskell-Morte-Library/pull/26
      
      The reader always fails if you actually try to get an instance of it.
      Trying to access a void value should not happen for well-formed
      instances, for example:
      
          *Data.Binary Data.Void> decode $ encode ([] :: [Void]) :: [Void]
          []
      57cf1f04
  33. 02 Oct, 2015 1 commit
  34. 28 Sep, 2015 1 commit
    • basvandijk's avatar
      Optimize roll by using foldl' instead of foldr · 1f643cbc
      basvandijk authored
      The "roll" benchmarks in the get executable show the difference:
      
        get roll
        benchmarking roll/foldr
        time                 547.4 ms   (537.8 ms .. 553.5 ms)
                             1.000 R²   (1.000 R² .. 1.000 R²)
        mean                 549.4 ms   (547.2 ms .. 550.4 ms)
        std dev              1.857 ms   (0.0 s .. 1.896 ms)
        variance introduced by outliers: 19% (moderately inflated)
      
        benchmarking roll/foldl'
        time                 434.7 ms   (426.4 ms .. 443.1 ms)
                             1.000 R²   (1.000 R² .. 1.000 R²)
        mean                 433.7 ms   (432.3 ms .. 434.7 ms)
        std dev              1.472 ms   (0.0 s .. 1.696 ms)
        variance introduced by outliers: 19% (moderately inflated)
      
      The "Integer/decode" benchmark shows the actual decoding speed.
      First the old implementation based on foldr:
      
        get Integer/decode
        benchmarking Integer/decode
        time                 552.9 ms   (540.2 ms .. 569.3 ms)
                             1.000 R²   (1.000 R² .. 1.000 R²)
        mean                 558.2 ms   (556.1 ms .. 559.3 ms)
        std dev              1.824 ms   (0.0 s .. 1.906 ms)
        variance introduced by outliers: 19% (moderately inflated)
      
      The new implementation based on foldl':
      
        get Integer/decode
        benchmarking Integer/decode
        time                 457.5 ms   (406.2 ms .. 505.6 ms)
                             0.998 R²   (0.994 R² .. 1.000 R²)
        mean                 455.9 ms   (448.3 ms .. 462.3 ms)
        std dev              10.11 ms   (0.0 s .. 11.02 ms)
        variance introduced by outliers: 19% (moderately inflated)
      1f643cbc
  35. 29 Jul, 2015 1 commit
  36. 06 Jun, 2015 1 commit
  37. 03 Jun, 2015 1 commit