Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.4.5: Add reverse encoders for packed repeated fields. #108

Merged
merged 29 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
705fa63
1.4.4: Add reverse encoders for packed repeated fields.
j6carey Aug 8, 2024
f1661ae
Add packedBools and packedBoolsReverse.
j6carey Aug 8, 2024
0ae1c74
Make names more uniform.
j6carey Aug 8, 2024
bea7a82
Add mapped forward builders.
j6carey Aug 8, 2024
434600a
Export etaMessageBuilder
j6carey Aug 12, 2024
fb7b0c6
Add some rewrite rules for empty strings.
j6carey Sep 23, 2024
55d555b
Remove unnecessary import.
j6carey Sep 23, 2024
6fcef04
Add unsafeFromByteString, unsafeFromShortByteString.
j6carey Sep 23, 2024
590261d
Update CHANGELOG.md
j6carey Sep 23, 2024
40a907d
shell.nix now defaults to GHC 9.4.8
j6carey Nov 18, 2024
97577e7
Add bytesIfNonempty.
j6carey Dec 3, 2024
f540d88
Avoid compiler warning.
j6carey Dec 3, 2024
2a8e434
Merge master
j6carey Jan 17, 2025
cba037c
Fast output of sequences of fixed-width elements of known length.
j6carey Feb 4, 2025
91b061b
Revise how reverse encoders work.
j6carey Mar 13, 2025
1427297
Tighten tests of ToRepeated
j6carey Mar 13, 2025
fafc8d3
Fix problem with doctests on GHC 8.10.7.
j6carey Mar 13, 2025
22772e3
Improve code sharing.
j6carey Mar 13, 2025
8cdf88b
Add repeatedMessageBuilder.
j6carey Mar 13, 2025
dfca0bb
Add nullRepeated.
j6carey Mar 13, 2025
d6b8250
More type-specific support for packed fields.
j6carey Mar 14, 2025
96447ec
Ensure field numbers are strict.
j6carey Mar 14, 2025
9664e8a
Support Acc and AccNE.
j6carey Mar 15, 2025
5071e43
actions/[email protected] -> v3.4.0
j6carey Mar 15, 2025
2692fde
Remove acc bounds for stack compatibliity.
j6carey Mar 16, 2025
ef9b17c
Remove support for acc package because stack does not provide it.
j6carey Mar 16, 2025
26a7977
Adopt review suggestion.
j6carey Mar 18, 2025
11bf866
Bump version to 1.4.5
j6carey Mar 18, 2025
4c6e8e7
Adopt review comments.
j6carey Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
stack-version: 2.11

- name: Cache dependencies
uses: actions/cache@v3.3.1
uses: actions/cache@v3.4.0
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1.4.5
- Add encoders for packed repeated fields that can iterate in
reverse order for speed when practical and will predict size
when it is inexpensive to do so.
- Add bytesIfNonempty, etaMessageBuilder, unsafeFromByteString,
unsafeFromShortByteString, repeatedMessageBuilder.

1.4.4
- Support GHC 9.10

Expand Down
9 changes: 4 additions & 5 deletions bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Proto3.Wire

import Control.Applicative (liftA2, liftA3)
import Control.Monad (forM)
import Data.Maybe
import Data.Word
import Data.IORef

Expand All @@ -39,7 +38,7 @@ instance Foldable Tree where
in a + a1 + a2

instance Foldable Rose where
foldMap f Bud = mempty
foldMap _ Bud = mempty
foldMap f (Rose x rs) = f x <> ((foldMap.foldMap) f rs)

intTreeParser :: De.Parser De.RawMessage (Tree Word64)
Expand Down Expand Up @@ -123,9 +122,9 @@ pullInt :: IORef [Word64] -> IO Word64
pullInt xs = do
xs' <- readIORef xs
case xs' of
[] -> pure (-1)
x : xs' -> do
writeIORef xs xs'
[] -> pure (negate 1)
x : xs'' -> do
writeIORef xs xs''
pure x

mkTree0 :: IO Word64 -> IO En.MessageBuilder
Expand Down
9 changes: 6 additions & 3 deletions proto3-wire.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: >=1.10

name: proto3-wire
version: 1.4.4
version: 1.4.5
synopsis: A low-level implementation of the Protocol Buffers (version 3) wire format
license: Apache-2.0
license-file: LICENSE
Expand Down Expand Up @@ -37,7 +37,7 @@ library
base >=4.12 && <=5.0
, bytestring >=0.10.6.0 && <0.13.0
, cereal >= 0.5.1 && <0.6
, containers >=0.5 && < 0.8
, containers >=0.5 && <0.8
, deepseq >=1.4 && <1.6
, hashable <1.6
, parameterized >=0.5.0.0 && <1
Expand All @@ -58,11 +58,13 @@ library
Proto3.Wire.Class
Proto3.Wire.Decode
Proto3.Wire.Encode
Proto3.Wire.Encode.Repeated
Proto3.Wire.FoldR
Proto3.Wire.Reverse
Proto3.Wire.Reverse.Internal
Proto3.Wire.Reverse.Prim
Proto3.Wire.Tutorial
Proto3.Wire.Types
Proto3.Wire.Reverse.Internal

other-modules:
Proto3.Wire.Reverse.Width
Expand All @@ -77,6 +79,7 @@ test-suite tests
base >=4.9 && <=5.0
, bytestring >=0.10.6.0 && <0.13.0
, cereal >= 0.5.1 && <0.6
, containers >=0.5 && <0.8
, doctest >= 0.7.0 && <0.24.0
, proto3-wire
, QuickCheck >=2.8 && <3.0
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ compiler ? "ghc948", enableStack ? false }:
{ compiler ? "ghc982", enableStack ? false }:

let
pkgs = import ./nix/pkgs.nix {
Expand Down
Loading
Loading