git.iko.soy/rowtype-yoga/purescript-protobuf
on master help sign in
WIP
commitc08fe5b201bc36044ca9165b91a97bd923f4a12a authorJames Brock <jamesbrock@gmail.com> dateSat 10 Apr 2021, 01:07 (6 years ago) parentcf78b01
3 files changed+10−3
nix/conformance.nix+3 nix/protobuf.nix+5−2 src/Protobuf/Runtime.purs+2−1
nix/conformance.nix+3
@@ -10,6 +10,9 @@ pkgs.mkShell {
1010 protobuf
1111 ];
1212 shellHook = ''
13+ protoc --version
14+ echo -n "purs "
15+ purs --version
1316 export PATH="./bin:$PATH" # PATH to protoc-gen-purescript
1417 set -e
1518 spago build
nix/protobuf.nix+5−2
@@ -3,13 +3,16 @@
33# https://nixos.wiki/wiki/Packaging/Quirks_and_Caveats
44# https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/protobuf/generic-v3.nix
55
6+# https://github.com/protocolbuffers/protobuf/blob/master/CHANGES.txt
67let
78 # version = "v3.9.2";
89 # sha256 = "080zxa9w1pxp5y05aiwc0c8mlqkkh98wmid4l7m99cliphsd4qnn";
9− version = "v3.11.4";
10− sha256 = "00g61f1yd8z5l0z0svmr3hms38ph35lcx2y7hivw6fahslw0l8yw";
10+ # version = "v3.11.4";
11+ # sha256 = "00g61f1yd8z5l0z0svmr3hms38ph35lcx2y7hivw6fahslw0l8yw";
1112 # version = "v3.13.0";
1213 # sha256 = "1nqsvi2yfr93kiwlinz8z7c68ilg1j75b2vcpzxzvripxx5h6xhd";
14+ version = "v3.14.0";
15+ sha256 = "1k4kkb78kdbz732wsph07v3zy3cz7l1msk2byrfvp0nb02sfl3a4";
1316 # version = "v3.15.6";
1417 # sha256 = "15mba1hxv2gmlljiwh4kvjw2s1s4cf470kvx9lvfhaklskjig1l5";
1518
src/Protobuf/Runtime.purs+2−1
@@ -273,13 +273,14 @@ label :: forall m s a. Monad m => String -> ParserT s m a -> ParserT s m a
273273label messagePrefix p = catchError p $ \ (ParseError message pos) ->
274274 throwError $ ParseError (messagePrefix <> message) pos
275275
276+-- | Merge the new left with the old right.
276277mergeWith :: forall a. (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
277278mergeWith f (Just l) (Just r) = Just (f l r)
278279mergeWith _ l Nothing = l
279280mergeWith _ Nothing r = r
280−mergeWith _ _ _ = Nothing
281281
282282-- | This is not quite the `Alt` class, because we need to flip the list append for `alt`.
283+-- | TODO this class should not exist.
283284class Mergeable a
284285 where
285286 -- | Merge the new left with the old right.