This project is mirrored from https://github.com/kolmodin/binary. Pull mirroring updated .
  1. 03 Jun, 2015 1 commit
  2. 31 May, 2015 3 commits
  3. 30 May, 2015 5 commits
  4. 28 May, 2015 3 commits
    • Lennart Kolmodin's avatar
      d8c1ee8d
    • bitonic's avatar
      Make `ensureN` more inliner-friendly... · f947333e
      bitonic authored
      ...by making the common case (when the input is big enough) non-recursive.
      f947333e
    • bitonic's avatar
      Remove quadratic behaviour in `ensureN`. · e46b7b61
      bitonic authored
      Chains of `B.append`s were being created by repeated calls to
      `demandInput`.
      
      Try the following program, which writes and read 100MB, to appreciate
      the difference:
      
      ```
      import qualified Data.ByteString as BS
      import qualified Data.ByteString.Lazy as BSL
      import Data.Binary (encode, decode)
      import Data.Char (ord)
      
      main :: IO ()
      main = do
      
        let inBs = BS.replicate 100000000 (fromIntegral $ ord 'a')
        BSL.writeFile "bs.bin" (encode inBs)
        putStrLn "writing done"
      
        bin <- BSL.readFile "bs.bin"
        -- This takes around 30 seconds and causes more than 10GB to be
        -- allocated.
        let outBs = decode bin
        print $ inBs == outBs
      ```
      e46b7b61
  5. 23 May, 2015 2 commits
  6. 23 Feb, 2015 2 commits
  7. 20 Feb, 2015 1 commit
    • ttuegel's avatar
      Make get :: Get Char total · 62c41d79
      ttuegel authored
      The old Binary instance for Char used Data.Char.chr, which calls error
      if given an invalid code point. The instance is modified to call fail
      instead of error on invalid code points, which is total (within the Get
      Monad). Calls to error inside Get will escape decodeOrFail.
      62c41d79
  8. 22 Jan, 2015 2 commits
  9. 17 Jan, 2015 2 commits
  10. 10 Jan, 2015 1 commit
  11. 01 Jan, 2015 2 commits
    • Lennart Kolmodin's avatar
      Fix compilation error. · 067a1929
      Lennart Kolmodin authored
      arbitrarySizedNatural is only defined when base >= 4.8.
      067a1929
    • Lennart Kolmodin's avatar
      Add instance for Natural. · 74b2c01c
      Lennart Kolmodin authored
      Natural is a new data type that comes with base-4.8 (GHC 7.10).
      We serialize it in the same way as we do with Integer.
      Since this is a new data type there are some ugly CPPs to handle whether
      Natural is there or not.
      Serialization tests have been added as well. Since QuickCheck doesn't yet
      implement instance Arbitrary Natural we do a workaround here.
      This fixes #63.
      74b2c01c
  12. 27 Dec, 2014 1 commit
  13. 26 Dec, 2014 1 commit
  14. 13 Dec, 2014 3 commits
  15. 25 Sep, 2014 8 commits
  16. 17 Sep, 2014 1 commit
  17. 17 Jul, 2014 1 commit
  18. 18 May, 2014 1 commit