mirror of
https://github.com/composewell/streamly.git
synced 2024-09-11 11:37:22 +03:00
Add TODO comments in Serialize.TH
This commit is contained in:
parent
e7b21daabe
commit
643c80378e
@ -172,6 +172,11 @@ shiftAdd conv xs =
|
|||||||
map (\(j, x) -> shiftL x (j * 8)) $ zip [0 ..] $ map conv xs
|
map (\(j, x) -> shiftL x (j * 8)) $ zip [0 ..] $ map conv xs
|
||||||
|
|
||||||
-- Note: This only works in little endian machines
|
-- Note: This only works in little endian machines
|
||||||
|
-- TODO:
|
||||||
|
-- Instead of generating this via TH can't we write it directly in Haskell and
|
||||||
|
-- use that? Creating one comparison function for each deserialization may be
|
||||||
|
-- too much code and may not be necessary.
|
||||||
|
-- Benchmark both the implementations and check.
|
||||||
xorCmp :: [Word8] -> Name -> Name -> Q Exp
|
xorCmp :: [Word8] -> Name -> Name -> Q Exp
|
||||||
xorCmp tag off arr =
|
xorCmp tag off arr =
|
||||||
case tagLen of
|
case tagLen of
|
||||||
@ -253,7 +258,10 @@ xorCmp tag off arr =
|
|||||||
-- Primitive serialization
|
-- Primitive serialization
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- XXX Batch serialize? See xorCmp
|
-- TODO:
|
||||||
|
-- Will this be too much of a code bloat?
|
||||||
|
-- Loop with the loop body unrolled?
|
||||||
|
-- Serialize this in batches similar to batch comparision in xorCmp?
|
||||||
serializeW8List :: Name -> Name -> [Word8] -> Q Exp
|
serializeW8List :: Name -> Name -> [Word8] -> Q Exp
|
||||||
serializeW8List off arr w8List = do
|
serializeW8List off arr w8List = do
|
||||||
[|let $(varP (makeN 0)) = $(varE off)
|
[|let $(varP (makeN 0)) = $(varE off)
|
||||||
|
Loading…
Reference in New Issue
Block a user