Commit Graph

114 Commits

Author SHA1 Message Date
Sylvain HENRY
858e615896 Add support for byte alignment and bit skip 2015-03-06 20:40:36 +01:00
Sylvain HENRY
4c202bbffb Add tests and fix bugs 2015-03-06 20:13:45 +01:00
Sylvain Henry
1d240236b6 Bump version 2015-03-06 14:54:26 +01:00
Sylvain Henry
cb2cbc45f2 Deprecate putWord*be 2015-03-06 14:53:53 +01:00
Sylvain Henry
af483e8026 BitOrder selection for Put 2015-03-06 14:49:47 +01:00
Sylvain Henry
a64cb3b80b Implement putByteString 2015-03-06 14:36:03 +01:00
Sylvain Henry
bf5c487cd8 Generalize putWord 2015-03-06 13:58:10 +01:00
Sylvain HENRY
3e7a8f9f5a Fix make_mask
x `fastShiftL` n isn't defined if n == 64 and x :: Word64
2015-03-06 10:20:38 +01:00
Sylvain HENRY
8d44be0558 Add bit order in put 2015-03-06 09:39:06 +01:00
Sylvain HENRY
9358c44428 Add helper modules 2015-03-06 09:33:09 +01:00
Sylvain HENRY
c64ffc682c Remove useless branches 2015-03-06 09:14:26 +01:00
Sylvain HENRY
ef428635b2 Bug fix 2015-03-04 07:48:35 +01:00
Sylvain HENRY
4dee78527e Add getBitOrder 2015-03-02 10:27:24 +01:00
Sylvain HENRY
40670cf69e Implement BL and LL bit orders 2015-03-02 02:24:09 +01:00
Sylvain HENRY
99f47ee9d7 Add withBitOrder 2015-03-02 01:04:06 +01:00
Sylvain HENRY
bf33730ff1 Fix readByteString for LB with offset=0 2015-03-02 01:04:06 +01:00
Sylvain HENRY
47cca38b2f Fix warning 2015-03-02 01:04:06 +01:00
Sylvain HENRY
7124284816 Deprecate functions with "be" suffix 2015-03-02 01:04:06 +01:00
Sylvain HENRY
0e68a2bc62 Add bit ordering to BitGet state 2015-03-02 00:26:37 +01:00
Sylvain HENRY
68ad583dd7 Implement support for different bit ordering 2015-03-01 23:28:56 +01:00
Sylvain HENRY
53379ac481 Bump version to 0.5.1 2015-02-26 22:08:01 +01:00
Sylvain HENRY
ed53a4b8a0 Fix GHC warnings 2015-02-26 22:08:01 +01:00
Sylvain HENRY
08842ad5ed Add skipBits and alignByte 2015-02-26 21:36:03 +01:00
Lennart Kolmodin
bd9cb81435 Bump version to 0.5 2015-01-09 20:40:21 +03:00
Lennart Kolmodin
1f9d92c284 Add Functor and Applicative instances to BitPut. 2015-01-09 20:20:30 +03:00
Lennart Kolmodin
941914707e travis: don't run 'cabal check'
It fails due to -O2 warning.
2015-01-09 20:14:21 +03:00
Lennart Kolmodin
b136049557 Add .gitignore 2015-01-09 20:08:29 +03:00
Lennart Kolmodin
1c810d0f54 Add Travis CI 2015-01-09 19:52:33 +03:00
Lennart Kolmodin
1032a97837 Bump version to 0.4 2015-01-09 16:40:31 +03:00
Lennart Kolmodin
a1f513c7fc Merge pull request #5 from polachok/bit-put
Don't leak higher bits in putWord8 and putWord16be
2013-04-09 13:06:08 -07:00
Alexander Polakov
2cb890819f Don't leak higher bits in putWord8 and putWord16be
- copy-paste make_mask from Get.hs
 - use it
2013-04-09 01:06:01 +04:00
Lennart Kolmodin
4dbf32a91c Expose long hidden bug.
Bug discovered by Alexander Polakov.
We change how putBool works to expose it, making it easier to fix,
lots of tests in the test suite breaks by this change,
but they shouldn't.
putWord8 is broken, as it may let bits we want to be unused leak into
the output. If some high bits are set in a Word8, but we don't want to
output them, they will anyway leak and corrupt previously written bits.
The following program is now broken with this commit;

broken = do
 putBool False
 putBool True

It'll output a byte: 11000000
instead of the expected: 01000000
2013-04-06 14:11:04 +04:00
Lennart Kolmodin
ac8e0cab6f tests: Also test Bools in program simulation 2013-04-06 14:10:13 +04:00
Lennart Kolmodin
0d2d17e8a9 tests: Add isEmpty to simulation 2013-04-01 23:05:19 +04:00
Lennart Kolmodin
9280cfae6d tests: Add simulations of BitGet programs 2013-04-01 21:26:55 +04:00
Lennart Kolmodin
2cc392f62e Merge branch 'master' of ssh://github.com/kolmodin/binary-bits 2013-03-31 23:56:06 +04:00
Lennart Kolmodin
743a30dbb5 Merge pull request #2 from polachok/master
getLazyByteString: read current byte + isEmpty
2013-03-31 07:55:34 -07:00
Alexander Polakov
39618a7ae4 isEmpty: check bs first
suggested by @kolmodin
2013-03-31 18:37:27 +04:00
Alexander Polakov
bec131cdb3 Fix isEmpty tests
- remove stupid Bool comparisons
 - no need for numeric parameter in prop_isEmptyOfConsumedEmpty

 suggested by @kolmodin
2013-03-31 16:40:56 +04:00
Lennart Kolmodin
7763587d6c tests: remove unused imports, fix some lints 2013-03-30 23:53:18 +04:00
Alexander Polakov
22c8278ad6 Add isEmpty 2013-03-29 06:22:29 +04:00
Alexander Polakov
dc3e9095a4 Make getLazyByteString read from current byte 2013-03-29 06:22:28 +04:00
Lennart Kolmodin
50e2ce0d92 Bump version to 0.3. 2013-03-14 20:13:52 +04:00
Lennart Kolmodin
89e4dffe35 Export getLazyByteString. 2013-03-14 15:11:34 +04:00
Lennart Kolmodin
de2fe8e15f Add getLazyByteString.
Don't allow block merging for this function, as
blocks are always done on strict bytestrings.
2013-03-14 08:26:21 +04:00
Lennart Kolmodin
c9ee63001b Bump version to 0.2. 2012-10-28 15:04:46 +04:00
Lennart Kolmodin
c0fcafbb73 Make tests compile with GHC 7.6.1 too. 2012-10-28 15:03:08 +04:00
Lennart Kolmodin
3cebf6c4e4 Port tests to binary >= 0.6.0.0. 2012-10-28 15:02:08 +04:00
Lennart Kolmodin
2b616b3df7 Fix to compile package with GHC 7.6.1
Issue reported by Eugene Kirpichov <ekirpichov@gmail.com>.
2012-10-28 15:00:46 +04:00
Lennart Kolmodin
596a7b5f49 Another 3% speedup. 2012-04-25 21:48:39 +04:00