packages/binary.git
4 years agoRemove INLINEs from GBinary/GSum methods ghc-head
Herbert Valerio Riedel [Thu, 25 Sep 2014 20:07:13 +0000 (22:07 +0200)] 
Remove INLINEs from GBinary/GSum methods

These interact very badly with GHC 7.9.x's simplifier

See also

 - https://ghc.haskell.org/trac/ghc/ticket/9630 and

 - https://ghc.haskell.org/trac/ghc/ticket/9583

Submitted upstream as https://github.com/kolmodin/binary/pull/62

4 years agoUse explicit import-list for `GHC.Base` import
Herbert Valerio Riedel [Wed, 17 Sep 2014 22:02:54 +0000 (00:02 +0200)] 
Use explicit import-list for `GHC.Base` import

submitted upstream as https://github.com/kolmodin/binary/pull/59

5 years agoRemove duplicated extension in LANGUAGE pragma
Jan Stolarek [Sat, 19 Apr 2014 09:13:11 +0000 (11:13 +0200)] 
Remove duplicated extension in LANGUAGE pragma

5 years agoAdd LANGUAGE extensions for inferred signatures.
Jan Stolarek [Sat, 19 Apr 2014 07:04:02 +0000 (09:04 +0200)] 
Add LANGUAGE extensions for inferred signatures.

Some of the inferred signatures required LANGUAGE extensions that
were not enabled. Since now GHC checks that we have to explicitly
list required extensions.

6 years agoVersion bump to 0.7.1.0. binary-0.7.1.0-release
Lennart Kolmodin [Wed, 1 May 2013 16:57:15 +0000 (20:57 +0400)] 
Version bump to 0.7.1.0.

6 years agoDepend on test-framework-quickcheck2 >= 0.3
Lennart Kolmodin [Sat, 20 Apr 2013 09:56:16 +0000 (13:56 +0400)] 
Depend on test-framework-quickcheck2 >= 0.3

test-framework-quickcheck2 depends on QC < 2.6 (even though it works
with QC 2.6...).
This workaround makes cabal pick an older version of QC.

6 years agoUpdates to the README.
Lennart Kolmodin [Sat, 20 Apr 2013 09:33:21 +0000 (13:33 +0400)] 
Updates to the README.

How to build, and why you probably don't need to.

6 years agoReimplement lookAheadE
Lennart Kolmodin [Sat, 20 Apr 2013 07:11:15 +0000 (11:11 +0400)] 
Reimplement lookAheadE

Including tests.

6 years agoUpdate binary.cabal about README.md's new name.
Lennart Kolmodin [Wed, 17 Apr 2013 06:02:49 +0000 (10:02 +0400)] 
Update binary.cabal about README.md's new name.

6 years agoMinor fixes to the README.
Lennart Kolmodin [Wed, 17 Apr 2013 05:47:25 +0000 (09:47 +0400)] 
Minor fixes to the README.

6 years agoFixed a typo.
Daniel Díaz [Wed, 17 Apr 2013 00:28:14 +0000 (21:28 -0300)] 
Fixed a typo.

6 years agoREADME: Added info about a binary instance example.
Daniel Díaz [Wed, 17 Apr 2013 00:27:09 +0000 (21:27 -0300)] 
README: Added info about a binary instance example.

6 years agoREADME updated with markdown format.
Daniel Díaz [Wed, 17 Apr 2013 00:24:03 +0000 (21:24 -0300)] 
README updated with markdown format.

The README now follows the markdown format, suitable to display in the GitHub repository site. Also, the documentation in this file has been slightly extended.

6 years agoAdded .md extension to README file
Daniel Díaz [Wed, 17 Apr 2013 00:11:44 +0000 (21:11 -0300)] 
Added .md extension to README file

6 years agoAdded MonadPlus instance.
Daniel Diaz [Tue, 16 Apr 2013 02:53:29 +0000 (22:53 -0400)] 
Added MonadPlus instance.

6 years agoAdd a Cereal bracket test.
Lennart Kolmodin [Tue, 5 Mar 2013 11:48:33 +0000 (15:48 +0400)] 
Add a Cereal bracket test.

6 years agoTypo.
Lennart Kolmodin [Sat, 2 Mar 2013 14:54:47 +0000 (18:54 +0400)] 
Typo.

6 years agoBump to 0.7.0.1
Lennart Kolmodin [Sat, 2 Mar 2013 07:52:46 +0000 (11:52 +0400)] 
Bump to 0.7.0.1

6 years agoFix code examples in documentation.
Lennart Kolmodin [Fri, 1 Mar 2013 21:27:35 +0000 (01:27 +0400)] 
Fix code examples in documentation.

The old name runGetPartial was used instead of runGetIncremental.

6 years agoBump to 0.7.0.0
Lennart Kolmodin [Fri, 1 Mar 2013 09:32:16 +0000 (13:32 +0400)] 
Bump to 0.7.0.0

6 years agoOnly run bracket bench on 100kb of brackets.
Lennart Kolmodin [Fri, 1 Mar 2013 05:37:11 +0000 (09:37 +0400)] 
Only run bracket bench on 100kb of brackets.

6 years agoFix the benchmark.
Lennart Kolmodin [Thu, 28 Feb 2013 19:11:49 +0000 (23:11 +0400)] 
Fix the benchmark.

Broke it during the "cleanup"...

6 years agoSpecial case when we pushBack an empty list.
Lennart Kolmodin [Thu, 28 Feb 2013 15:57:26 +0000 (19:57 +0400)] 
Special case when we pushBack an empty list.

Gives about 10% speedup for the <|> of many chunks.

6 years agoClean up <|> benchmark.
Lennart Kolmodin [Thu, 28 Feb 2013 15:48:21 +0000 (19:48 +0400)] 
Clean up <|> benchmark.

Also add attoparsec to do the same <|> benchmark.
For attoparsec, we bench with a strict bytestring,
with a lazy bytestring with only one chunk, and a
lazy bytestring with many chunks.

6 years agoAdd module documentation for Data.Binary.Get.
Lennart Kolmodin [Sun, 24 Feb 2013 11:12:59 +0000 (15:12 +0400)] 
Add module documentation for Data.Binary.Get.

Issue #15.

6 years agoMore documentation.
Lennart Kolmodin [Sat, 23 Feb 2013 16:46:27 +0000 (20:46 +0400)] 
More documentation.

Issue #15.

6 years agoAdd all files to binary.cabal
Lennart Kolmodin [Sat, 23 Feb 2013 10:00:57 +0000 (14:00 +0400)] 
Add all files to binary.cabal

Makes 'cabal sdist' work as intended.

6 years agoRemove ancient TODO
Lennart Kolmodin [Sat, 23 Feb 2013 09:36:35 +0000 (13:36 +0400)] 
Remove ancient TODO

6 years agoUpdate Don Stewart's email address.
Lennart Kolmodin [Thu, 21 Feb 2013 08:03:47 +0000 (12:03 +0400)] 
Update Don Stewart's email address.

6 years agoUpdate benchmark. Add cereal and attoparsec for comparison.
Lennart Kolmodin [Wed, 20 Feb 2013 09:12:39 +0000 (13:12 +0400)] 
Update benchmark. Add cereal and attoparsec for comparison.

6 years agoFunction haddocks for lookAhead and lookAheadM.
Lennart Kolmodin [Mon, 18 Feb 2013 20:08:16 +0000 (00:08 +0400)] 
Function haddocks for lookAhead and lookAheadM.

Issue #17.

6 years agoSilent warning.
Lennart Kolmodin [Mon, 18 Feb 2013 12:03:11 +0000 (16:03 +0400)] 
Silent warning.

6 years agoModel test: provide better shrinking.
Lennart Kolmodin [Mon, 18 Feb 2013 08:08:41 +0000 (12:08 +0400)] 
Model test: provide better shrinking.

The model now has a constructor Actions which holds a list of Action.
It can be used to unpack a LookAhead(M) or Try in order to shrink the program.

6 years agoCleanup instance Arbitrary of lazy bytestrings.
Lennart Kolmodin [Sun, 17 Feb 2013 19:38:13 +0000 (23:38 +0400)] 
Cleanup instance Arbitrary of lazy bytestrings.

6 years agoImplement lookAheadM.
Lennart Kolmodin [Sun, 17 Feb 2013 19:37:07 +0000 (23:37 +0400)] 
Implement lookAheadM.

Also with tests.

6 years agoCompile QC tests with -O2.
Lennart Kolmodin [Sun, 17 Feb 2013 16:55:43 +0000 (20:55 +0400)] 
Compile QC tests with -O2.

6 years agoModel test: make sure decoded data is as expected (not only offset).
Lennart Kolmodin [Sun, 17 Feb 2013 16:54:06 +0000 (20:54 +0400)] 
Model test: make sure decoded data is as expected (not only offset).

Previously we tracked only byte positions in the model, and compared
with the decoders' offset (via bytesRead).
Now we give the whole input to the evaluator, and thanks to that we track
offset we can easily also compare that the decoded data is what we expect.

6 years agoImplement <|> using runAndKeepTrack.
Lennart Kolmodin [Sun, 17 Feb 2013 12:47:54 +0000 (16:47 +0400)] 
Implement <|> using runAndKeepTrack.

6 years agoAdd .cabal-sandbox to .gitignore.
Lennart Kolmodin [Sat, 16 Feb 2013 15:54:31 +0000 (19:54 +0400)] 
Add .cabal-sandbox to .gitignore.

6 years agoImplement lookAhead.
Lennart Kolmodin [Sat, 16 Feb 2013 08:10:22 +0000 (12:10 +0400)] 
Implement lookAhead.

Issue #17. Test present, documentation still missing.
This function was removed with the 0.6.* branch, and had quite few users.
The plan was to use <|> instead, but lookAhead was missed since it
offers some functionality that <|> cannot provide without larger restructuring of the application.
lookAhead can be implemented in binary without affecting any other functionality,
so here it is again.

This also makes 0.6.* more backwards compatible with earlier versions,
this saving the developer from #if MIN_VERSION hacks.

6 years agoAdd test for encodeFile and decodeFile.
Lennart Kolmodin [Fri, 15 Feb 2013 20:17:40 +0000 (00:17 +0400)] 
Add test for encodeFile and decodeFile.

Issue #22.

6 years agoDocs for decodeFile and decodeFileOrFail.
Lennart Kolmodin [Fri, 15 Feb 2013 18:12:21 +0000 (22:12 +0400)] 
Docs for decodeFile and decodeFileOrFail.

Issue #22.

6 years agoAdd decodeOrFail and decodeFileOrFail.
Lennart Kolmodin [Fri, 15 Feb 2013 11:19:18 +0000 (15:19 +0400)] 
Add decodeOrFail and decodeFileOrFail.

Issue #22. Documentation and tests still missing.
Rewrote decodeFile* to use chunk pushing style.
This code currently uses Data.ByteString.Lazy.Internal.defaultChunkSize
when reading from handles. I'd prefer to be more independent
of bytestring's internals, let's copy the code to this module.

6 years agoO(n) version of pushChunks, when joining unused chunks.
Lennart Kolmodin [Thu, 14 Feb 2013 06:38:48 +0000 (10:38 +0400)] 
O(n) version of pushChunks, when joining unused chunks.

6 years agoAvoid rebuilding LBS with L.fromChunks.
Lennart Kolmodin [Wed, 13 Feb 2013 20:45:40 +0000 (00:45 +0400)] 
Avoid rebuilding LBS with L.fromChunks.

Fixes #23.
For consistency, also use takeHeadChunk and dropHeadChunk where we can.

6 years agoMake runGetState more efficient, especially if called many times.
Lennart Kolmodin [Wed, 13 Feb 2013 19:17:05 +0000 (23:17 +0400)] 
Make runGetState more efficient, especially if called many times.

Issue #23. Needs to be done for more functions in this module.

6 years agoAdd Bas van Dijk to contributors as he wrote the original generics code
Lennart Kolmodin [Mon, 21 Jan 2013 08:57:01 +0000 (12:57 +0400)] 
Add Bas van Dijk to contributors as he wrote the original generics code

The generics code originally came from cereal.

6 years agoMerge pull request #21 from Peaker/master
Lennart Kolmodin [Mon, 21 Jan 2013 08:52:25 +0000 (00:52 -0800)] 
Merge pull request #21 from Peaker/master

Remove unused Ord constraint from Map and Set Binary instances

6 years agoRemove unused Ord constraint from Set and Map
Eyal Lotem [Tue, 15 Jan 2013 15:08:38 +0000 (17:08 +0200)] 
Remove unused Ord constraint from Set and Map

6 years agoBump version to 0.6.4.0.
Lennart Kolmodin [Sat, 24 Nov 2012 06:54:57 +0000 (10:54 +0400)] 
Bump version to 0.6.4.0.

6 years agoMerge branch 'rungetorfail' of https://github.com/tibbe/binary into tibbe-rungetorfail
Lennart Kolmodin [Sat, 24 Nov 2012 06:43:06 +0000 (10:43 +0400)] 
Merge branch 'rungetorfail' of https://github.com/tibbe/binary into tibbe-rungetorfail

6 years agoFix build error for generics with ghc <= 7.6.1.
Lennart Kolmodin [Thu, 22 Nov 2012 06:02:32 +0000 (10:02 +0400)] 
Fix build error for generics with ghc <= 7.6.1.

6 years agoBump version to 0.6.3.0.
Lennart Kolmodin [Thu, 22 Nov 2012 05:50:24 +0000 (09:50 +0400)] 
Bump version to 0.6.3.0.

6 years agoDoc updates.
Lennart Kolmodin [Thu, 22 Nov 2012 05:48:43 +0000 (09:48 +0400)] 
Doc updates.

6 years agoMake docs less confusing.
Lennart Kolmodin [Thu, 22 Nov 2012 05:37:51 +0000 (09:37 +0400)] 
Make docs less confusing.

6 years agoDrop unneeded LANGUAGE pragma
Bryan O'Sullivan [Wed, 21 Nov 2012 23:54:39 +0000 (15:54 -0800)] 
Drop unneeded LANGUAGE pragma

6 years agoA small doc improvement
Bryan O'Sullivan [Wed, 21 Nov 2012 23:48:14 +0000 (15:48 -0800)] 
A small doc improvement

6 years agoFix up the default instances
Bryan O'Sullivan [Wed, 21 Nov 2012 23:40:41 +0000 (15:40 -0800)] 
Fix up the default instances

6 years agoAlmost-working generics, with deliberate type bug
Bryan O'Sullivan [Wed, 21 Nov 2012 23:39:01 +0000 (15:39 -0800)] 
Almost-working generics, with deliberate type bug

6 years agoDrop redundant info from .cabal file
Bryan O'Sullivan [Wed, 21 Nov 2012 22:21:40 +0000 (14:21 -0800)] 
Drop redundant info from .cabal file

6 years agoSmall documentation tweaks
Johan Tibell [Wed, 21 Nov 2012 18:21:43 +0000 (10:21 -0800)] 
Small documentation tweaks

6 years agoAdd runGetOrFail
Johan Tibell [Wed, 21 Nov 2012 18:14:48 +0000 (10:14 -0800)] 
Add runGetOrFail

runGetOrFail provides a compromise between the simple runGet interface
and the fully general runGetIncremental interface. It takes all input up
front but it does allow callers to gracefully handle parse errors.

6 years agoSplit Binary class into its own module
Bryan O'Sullivan [Wed, 21 Nov 2012 17:47:54 +0000 (09:47 -0800)] 
Split Binary class into its own module

--HG--
rename : src/Data/Binary.hs => src/Data/Binary/Class.hs

6 years agoQuiet a GHC warning in tests
Bryan O'Sullivan [Wed, 21 Nov 2012 17:34:39 +0000 (09:34 -0800)] 
Quiet a GHC warning in tests

6 years agoAdd Mercurial ignore file
Bryan O'Sullivan [Wed, 21 Nov 2012 17:34:24 +0000 (09:34 -0800)] 
Add Mercurial ignore file

6 years agoMinor cleanup in Builder benchmark.
Lennart Kolmodin [Thu, 1 Nov 2012 07:41:57 +0000 (11:41 +0400)] 
Minor cleanup in Builder benchmark.

6 years agoImplement NFData for Lazy ByteStrings
Lennart Kolmodin [Tue, 23 Oct 2012 18:31:03 +0000 (22:31 +0400)] 
Implement NFData for Lazy ByteStrings

Trying to fix benchmarks when using older bytestring library without
support for NFData.

6 years agoAdd model based testing for bytesRead in <|>.
Lennart Kolmodin [Wed, 17 Oct 2012 18:49:05 +0000 (22:49 +0400)] 
Add model based testing for bytesRead in <|>.

6 years agoBump version to 0.6.2.0.
Lennart Kolmodin [Mon, 8 Oct 2012 06:40:32 +0000 (10:40 +0400)] 
Bump version to 0.6.2.0.

6 years agoRemove developer flag from binary.cabal
Lennart Kolmodin [Mon, 8 Oct 2012 06:39:51 +0000 (10:39 +0400)] 
Remove developer flag from binary.cabal

6 years agoEfficient versions of 'some' and 'many'.
Lennart Kolmodin [Sat, 6 Oct 2012 06:32:35 +0000 (10:32 +0400)] 
Efficient versions of 'some' and 'many'.

The Get monad cannot quickly process nested <|> very quickly (when asking for
more input, or BytesRead), so rewrite the common 'some' and 'many' functions to
not nest <|>.

6 years agoNo need to recompile everything each time for system-bench.
Lennart Kolmodin [Sat, 6 Oct 2012 06:30:36 +0000 (10:30 +0400)] 
No need to recompile everything each time for system-bench.

6 years agoCleanup that also gave a nice speed improvement.
Lennart Kolmodin [Thu, 4 Oct 2012 15:38:48 +0000 (19:38 +0400)] 
Cleanup that also gave a nice speed improvement.

Enable Alternative <|> benchmark.

6 years agoFix a bug related to <|> and bytesRead.
Lennart Kolmodin [Thu, 4 Oct 2012 09:05:50 +0000 (13:05 +0400)] 
Fix a bug related to <|> and bytesRead.

The wrong offset was returned when the first function in a try
operation was bytesRead, and the current chunk was non-empty.
In that case, the chunk would have been considered to be consumed
although it was not.

6 years agoAdd benchmarks to .cabal
Lennart Kolmodin [Thu, 27 Sep 2012 06:24:54 +0000 (10:24 +0400)] 
Add benchmarks to .cabal

Build them with:
  $ cabal configure --enable-benchmarks
  $ cabal build

and run them:
  $ cabal bench

6 years agoFurther documentation fixes.
Lennart Kolmodin [Wed, 26 Sep 2012 08:30:58 +0000 (12:30 +0400)] 
Further documentation fixes.

6 years agofix some typos
Gabor Greif [Tue, 25 Sep 2012 22:28:54 +0000 (01:28 +0300)] 
fix some typos

6 years agoFixes to upload 0.6.1.0 to hackage.
Lennart Kolmodin [Thu, 20 Sep 2012 07:30:12 +0000 (11:30 +0400)] 
Fixes to upload 0.6.1.0 to hackage.

Need upper range on base, not allowed to add -fhpc even under development flag
that defaults to false.

6 years agoBump version to 0.6.1.0.
Lennart Kolmodin [Thu, 20 Sep 2012 07:26:44 +0000 (11:26 +0400)] 
Bump version to 0.6.1.0.

6 years agoFix bug where a Decoder could return Partial multiple times.
Lennart Kolmodin [Thu, 20 Sep 2012 07:17:48 +0000 (11:17 +0400)] 
Fix bug where a Decoder could return Partial multiple times.

'noMeansNo' had a bug with the BytesRead constructor where it would not keep
track of multiple returns of Partial.
Test added.

6 years agoRequire random-1.0.1.0 or newer.
Lennart Kolmodin [Tue, 18 Sep 2012 20:33:55 +0000 (00:33 +0400)] 
Require random-1.0.1.0 or newer.

6 years agoRequire random-1.0.1.0 or newer.
Lennart Kolmodin [Tue, 18 Sep 2012 20:25:19 +0000 (00:25 +0400)] 
Require random-1.0.1.0 or newer.

Easiest way to make the tests compile on GHC 7.0.4.
Undo previous code that didn't use the Random Int64 instance.

6 years agoImport GHC.Base for GHC < 7.2. For newer GHCs it's not needed.
Lennart Kolmodin [Tue, 18 Sep 2012 07:22:46 +0000 (11:22 +0400)] 
Import GHC.Base for GHC < 7.2. For newer GHCs it's not needed.

6 years agoDon't use Random Int64 instance.
Lennart Kolmodin [Tue, 18 Sep 2012 07:14:45 +0000 (11:14 +0400)] 
Don't use Random Int64 instance.

The instance does not exist in older versions 'random' packages, like
random-1.0.0.3 which shipped with GHC 7.0.4.

6 years agoRemove old flags from cabal file.
Lennart Kolmodin [Tue, 18 Sep 2012 06:59:04 +0000 (10:59 +0400)] 
Remove old flags from cabal file.

The flags handled variations of the package 'base' before/after it was split
into several packages. This was a few years ago, so now we assume everybody has
base >= 3.

6 years agoAllow to run tests through Cabal.
Lennart Kolmodin [Tue, 18 Sep 2012 06:53:22 +0000 (10:53 +0400)] 
Allow to run tests through Cabal.

6 years agoDocs.
Lennart Kolmodin [Sun, 16 Sep 2012 19:23:53 +0000 (23:23 +0400)] 
Docs.

6 years agoDocumentation fix for 'remaining'.
Lennart Kolmodin [Sun, 16 Sep 2012 19:17:43 +0000 (23:17 +0400)] 
Documentation fix for 'remaining'.

6 years agoFix -Wall warnings in builder.
Lennart Kolmodin [Sun, 16 Sep 2012 19:08:53 +0000 (23:08 +0400)] 
Fix -Wall warnings in builder.

6 years ago'source-repository' needs cabal-version>=1.6.
Lennart Kolmodin [Sun, 16 Sep 2012 19:03:33 +0000 (23:03 +0400)] 
'source-repository' needs cabal-version>=1.6.

Also update which versions of GHC we've tested with.

6 years agoQuickCheck-2.5 already defines Arbitrary Ordering.
Lennart Kolmodin [Sun, 16 Sep 2012 19:00:29 +0000 (23:00 +0400)] 
QuickCheck-2.5 already defines Arbitrary Ordering.

Remove ours. Need to depend on quickcheck>=2.5 once we build the tests with
cabal.

6 years agoDocumentation fix.
Lennart Kolmodin [Sun, 16 Sep 2012 18:30:28 +0000 (22:30 +0400)] 
Documentation fix.

6 years agoMerge branch 'cps'
Lennart Kolmodin [Sun, 16 Sep 2012 18:02:49 +0000 (22:02 +0400)] 
Merge branch 'cps'

Conflicts:
binary.cabal

6 years agoAdd MachDeps.h to use WORD_SIZE_IN_BITS.
Lennart Kolmodin [Sun, 16 Sep 2012 15:26:34 +0000 (19:26 +0400)] 
Add MachDeps.h to use WORD_SIZE_IN_BITS.

6 years agoRename 'pushEndInput' -> 'pushEndOfInput'.
Lennart Kolmodin [Sun, 16 Sep 2012 11:31:47 +0000 (13:31 +0200)] 
Rename 'pushEndInput' -> 'pushEndOfInput'.

6 years agoDocumentation fixes.
Lennart Kolmodin [Sun, 16 Sep 2012 11:24:57 +0000 (13:24 +0200)] 
Documentation fixes.

6 years agoImplement 'bytesRead' from the 0.5 API.
Lennart Kolmodin [Sun, 16 Sep 2012 11:13:23 +0000 (13:13 +0200)] 
Implement 'bytesRead' from the 0.5 API.

Introducing a new constructor 'BytesRead' in the internal Decoder,
containing the number of unused bytes and the continuation.
The outer decoder runner calculates the length and executes the
continuation.

6 years agoRename any occurence of 'parse*' to 'decode*'.
Lennart Kolmodin [Sun, 16 Sep 2012 08:38:54 +0000 (10:38 +0200)] 
Rename any occurence of 'parse*' to 'decode*'.

6 years agoMake the get benchmark compile with GHC 7.6.1.
Lennart Kolmodin [Sun, 16 Sep 2012 07:05:56 +0000 (09:05 +0200)] 
Make the get benchmark compile with GHC 7.6.1.

6 years agoMake the builder test compile on GHC 7.6.1.
Lennart Kolmodin [Sun, 16 Sep 2012 07:04:35 +0000 (09:04 +0200)] 
Make the builder test compile on GHC 7.6.1.