flatbuffers-parser 0.1.0.1 → 0.1.1.0
raw patch · 2 files changed
+8/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Flatbuffers.Parser: UnsupportedUnionTag :: Error
+ Flatbuffers.Parser: constructUnionFromList :: [TableParser a] -> UnionParser a
+ Flatbuffers.Parser: tableParserThrow :: Error -> TableParser a
Files
flatbuffers-parser.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.4 name: flatbuffers-parser-version: 0.1.0.1+version: 0.1.1.0 synopsis: Parse flatbuffers license: BSD-3-Clause license-file: LICENSE
src/Flatbuffers/Parser.hs view
@@ -10,6 +10,7 @@ , UnionParser , Error(..) , run+ , tableParserThrow -- * Table Fields , boolean , int8@@ -29,6 +30,7 @@ -- * Unions , constructUnion2 , constructUnion3+ , constructUnionFromList ) where import Prelude hiding (length)@@ -57,6 +59,7 @@ import qualified Data.Bytes.Types import qualified Data.Bytes.Text.Utf8 as Utf8 import qualified Data.Primitive.ByteArray.LittleEndian as LE+import qualified GHC.Exts as Exts -- We do not include the vtable length in the slice since that number -- is already captured by the Sliced data constructor itself. We begin@@ -109,6 +112,7 @@ | ExpectedWord8EqButGot !Word8 !Word8 | ExpectedWord16EqButGot !Word16 !Word16 | MissingFieldWithIndex !Int+ | UnsupportedUnionTag deriving (Show) type Parser :: Type -> Type@@ -165,6 +169,9 @@ constructUnion3 :: TableParser a -> TableParser a -> TableParser a -> UnionParser a constructUnion3 a b c = UnionParser (Contiguous.construct3 a b c)++constructUnionFromList :: [TableParser a] -> UnionParser a+constructUnionFromList xs = UnionParser (Exts.fromList xs) -- | Reads the first four bytes to determine the root table. run :: TableParser a -> ByteArray -> Either Error a