packages feed

rattletrap 6.0.1 → 6.0.2

raw patch · 232 files changed

+972/−494 lines, 232 filesdep +clockdep ~basedep ~containersdep ~template-haskellsetup-changedPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: clock

Dependency ranges changed: base, containers, template-haskell

API changes (from Hackage documentation)

- Rattletrap.Decode.Common: getLazyByteString :: Int64 -> Get ByteString
- Rattletrap.Decode.Common: getLazyByteStringBits :: Int -> DecodeBits ByteString
+ Rattletrap.Decode.Common: getByteString :: Int -> Get ByteString
+ Rattletrap.Decode.Common: getByteStringBits :: Int -> DecodeBits ByteString
- Rattletrap: DictionaryElement :: Str -> a -> (Dictionary a) -> Dictionary a
+ Rattletrap: DictionaryElement :: Str -> a -> Dictionary a -> Dictionary a
- Rattletrap: PropertyValueArray :: (List (Dictionary a)) -> PropertyValue a
+ Rattletrap: PropertyValueArray :: List (Dictionary a) -> PropertyValue a
- Rattletrap: PropertyValueByte :: Str -> (Maybe Str) -> PropertyValue a
+ Rattletrap: PropertyValueByte :: Str -> Maybe Str -> PropertyValue a
- Rattletrap.Type.Dictionary: DictionaryElement :: Str -> a -> (Dictionary a) -> Dictionary a
+ Rattletrap.Type.Dictionary: DictionaryElement :: Str -> a -> Dictionary a -> Dictionary a
- Rattletrap.Type.ProductAttribute: ProductAttributeValueUserColorOld :: (Maybe Word32) -> ProductAttributeValue
+ Rattletrap.Type.ProductAttribute: ProductAttributeValueUserColorOld :: Maybe Word32 -> ProductAttributeValue
- Rattletrap.Type.PropertyValue: PropertyValueArray :: (List (Dictionary a)) -> PropertyValue a
+ Rattletrap.Type.PropertyValue: PropertyValueArray :: List (Dictionary a) -> PropertyValue a
- Rattletrap.Type.PropertyValue: PropertyValueByte :: Str -> (Maybe Str) -> PropertyValue a
+ Rattletrap.Type.PropertyValue: PropertyValueByte :: Str -> Maybe Str -> PropertyValue a

Files

Setup.hs view
@@ -1,3 +1,8 @@+module Main+  ( main+  )+where+ import qualified Distribution.Simple as Cabal  main :: IO ()
executables/Main.hs view
@@ -1,5 +1,6 @@ module Main   ( main-  ) where+  )+where  import Rattletrap.Console.Main (main)
library/Rattletrap.hs view
@@ -69,7 +69,8 @@   , Rattletrap.Type.ClassMapping.ClassMapping(..)   , Rattletrap.Type.Cache.Cache(..)   , Rattletrap.Type.AttributeMapping.AttributeMapping(..)-  ) where+  )+where  import qualified Rattletrap.Type.AppliedDamageAttribute import qualified Rattletrap.Type.Attribute
library/Rattletrap/Console/Main.hs view
@@ -1,10 +1,12 @@ module Rattletrap.Console.Main   ( main   , rattletrap-  ) where+  )+where  import qualified Control.Monad as Monad import qualified Data.Aeson as Json+import qualified Data.ByteString as Bytes import qualified Data.ByteString.Lazy as LazyBytes import qualified Data.Version as Version import qualified Network.HTTP.Client as Client@@ -35,31 +37,32 @@   let encode = getEncoder config   putOutput config (encode replay) -getDecoder :: Config -> LazyBytes.ByteString -> Either String Rattletrap.Replay+getDecoder :: Config -> Bytes.ByteString -> Either String Rattletrap.Replay getDecoder config = case getMode config of   ModeDecode -> Rattletrap.decodeReplayFile   ModeEncode -> Rattletrap.decodeReplayJson -getEncoder :: Config -> Rattletrap.Replay -> LazyBytes.ByteString+getEncoder :: Config -> Rattletrap.Replay -> Bytes.ByteString getEncoder config = case getMode config of-  ModeDecode ->-    if configCompact config then Json.encode else Rattletrap.encodeReplayJson+  ModeDecode -> if configCompact config+    then LazyBytes.toStrict . Json.encode+    else Rattletrap.encodeReplayJson   ModeEncode -> Rattletrap.encodeReplayFile -getInput :: Config -> IO LazyBytes.ByteString+getInput :: Config -> IO Bytes.ByteString getInput config = case configInput config of-  Nothing -> LazyBytes.getContents+  Nothing -> Bytes.getContents   Just fileOrUrl -> case Client.parseUrlThrow fileOrUrl of-    Nothing -> LazyBytes.readFile fileOrUrl+    Nothing -> Bytes.readFile fileOrUrl     Just request -> do       manager <- Client.newTlsManager       response <- Client.httpLbs request manager-      pure (Client.responseBody response)+      pure (LazyBytes.toStrict (Client.responseBody response)) -putOutput :: Config -> LazyBytes.ByteString -> IO ()+putOutput :: Config -> Bytes.ByteString -> IO () putOutput config = case configOutput config of-  Nothing -> LazyBytes.putStr-  Just file -> LazyBytes.writeFile file+  Nothing -> Bytes.putStr+  Just file -> Bytes.writeFile file  getConfig :: [String] -> IO Config getConfig arguments = do@@ -104,7 +107,7 @@ inputOption = Console.Option   ['i']   ["input"]-  ( Console.ReqArg+  (Console.ReqArg     (\input config -> pure config { configInput = Just input })     "FILE|URL"   )@@ -114,8 +117,8 @@ modeOption = Console.Option   ['m']   ["mode"]-  ( Console.ReqArg-    ( \rawMode config -> do+  (Console.ReqArg+    (\rawMode config -> do       mode <- parseMode rawMode       pure config { configMode = Just mode }     )@@ -127,7 +130,7 @@ outputOption = Console.Option   ['o']   ["output"]-  ( Console.ReqArg+  (Console.ReqArg     (\output config -> pure config { configOutput = Just output })     "FILE"   )
library/Rattletrap/Data.hs view
@@ -1,3 +1,4 @@+-- brittany --columns 120 module Rattletrap.Data   ( rawParentClasses   , rawClassesWithLocation@@ -5,7 +6,8 @@   , rawObjectClasses   , rawAttributeTypes   , rawCrc32Table-  ) where+  )+where  import Rattletrap.Type.AttributeType @@ -102,6 +104,7 @@   , "TAGame.Ball_TA"   , "TAGame.Car_Season_TA"   , "TAGame.Car_TA"+  -- This comments forces Brittany to use a multi-line layout for this list.   ]  rawObjectClasses :: [(String, String)]@@ -326,68 +329,260 @@  rawCrc32Table :: Integral a => [a] rawCrc32Table =-  [ 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9-  , 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005-  , 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61-  , 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd-  , 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9-  , 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75-  , 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011-  , 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd-  , 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039-  , 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5-  , 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81-  , 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d-  , 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49-  , 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95-  , 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1-  , 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d-  , 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae-  , 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072-  , 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16-  , 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca-  , 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde-  , 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02-  , 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066-  , 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba-  , 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e-  , 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692-  , 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6-  , 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a-  , 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e-  , 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2-  , 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686-  , 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a-  , 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637-  , 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb-  , 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f-  , 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53-  , 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47-  , 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b-  , 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff-  , 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623-  , 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7-  , 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b-  , 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f-  , 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3-  , 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7-  , 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b-  , 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f-  , 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3-  , 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640-  , 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c-  , 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8-  , 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24-  , 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30-  , 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec-  , 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088-  , 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654-  , 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0-  , 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c-  , 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18-  , 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4-  , 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0-  , 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c-  , 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668-  , 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4+  [ 0x00000000+  , 0x04c11db7+  , 0x09823b6e+  , 0x0d4326d9+  , 0x130476dc+  , 0x17c56b6b+  , 0x1a864db2+  , 0x1e475005+  , 0x2608edb8+  , 0x22c9f00f+  , 0x2f8ad6d6+  , 0x2b4bcb61+  , 0x350c9b64+  , 0x31cd86d3+  , 0x3c8ea00a+  , 0x384fbdbd+  , 0x4c11db70+  , 0x48d0c6c7+  , 0x4593e01e+  , 0x4152fda9+  , 0x5f15adac+  , 0x5bd4b01b+  , 0x569796c2+  , 0x52568b75+  , 0x6a1936c8+  , 0x6ed82b7f+  , 0x639b0da6+  , 0x675a1011+  , 0x791d4014+  , 0x7ddc5da3+  , 0x709f7b7a+  , 0x745e66cd+  , 0x9823b6e0+  , 0x9ce2ab57+  , 0x91a18d8e+  , 0x95609039+  , 0x8b27c03c+  , 0x8fe6dd8b+  , 0x82a5fb52+  , 0x8664e6e5+  , 0xbe2b5b58+  , 0xbaea46ef+  , 0xb7a96036+  , 0xb3687d81+  , 0xad2f2d84+  , 0xa9ee3033+  , 0xa4ad16ea+  , 0xa06c0b5d+  , 0xd4326d90+  , 0xd0f37027+  , 0xddb056fe+  , 0xd9714b49+  , 0xc7361b4c+  , 0xc3f706fb+  , 0xceb42022+  , 0xca753d95+  , 0xf23a8028+  , 0xf6fb9d9f+  , 0xfbb8bb46+  , 0xff79a6f1+  , 0xe13ef6f4+  , 0xe5ffeb43+  , 0xe8bccd9a+  , 0xec7dd02d+  , 0x34867077+  , 0x30476dc0+  , 0x3d044b19+  , 0x39c556ae+  , 0x278206ab+  , 0x23431b1c+  , 0x2e003dc5+  , 0x2ac12072+  , 0x128e9dcf+  , 0x164f8078+  , 0x1b0ca6a1+  , 0x1fcdbb16+  , 0x018aeb13+  , 0x054bf6a4+  , 0x0808d07d+  , 0x0cc9cdca+  , 0x7897ab07+  , 0x7c56b6b0+  , 0x71159069+  , 0x75d48dde+  , 0x6b93dddb+  , 0x6f52c06c+  , 0x6211e6b5+  , 0x66d0fb02+  , 0x5e9f46bf+  , 0x5a5e5b08+  , 0x571d7dd1+  , 0x53dc6066+  , 0x4d9b3063+  , 0x495a2dd4+  , 0x44190b0d+  , 0x40d816ba+  , 0xaca5c697+  , 0xa864db20+  , 0xa527fdf9+  , 0xa1e6e04e+  , 0xbfa1b04b+  , 0xbb60adfc+  , 0xb6238b25+  , 0xb2e29692+  , 0x8aad2b2f+  , 0x8e6c3698+  , 0x832f1041+  , 0x87ee0df6+  , 0x99a95df3+  , 0x9d684044+  , 0x902b669d+  , 0x94ea7b2a+  , 0xe0b41de7+  , 0xe4750050+  , 0xe9362689+  , 0xedf73b3e+  , 0xf3b06b3b+  , 0xf771768c+  , 0xfa325055+  , 0xfef34de2+  , 0xc6bcf05f+  , 0xc27dede8+  , 0xcf3ecb31+  , 0xcbffd686+  , 0xd5b88683+  , 0xd1799b34+  , 0xdc3abded+  , 0xd8fba05a+  , 0x690ce0ee+  , 0x6dcdfd59+  , 0x608edb80+  , 0x644fc637+  , 0x7a089632+  , 0x7ec98b85+  , 0x738aad5c+  , 0x774bb0eb+  , 0x4f040d56+  , 0x4bc510e1+  , 0x46863638+  , 0x42472b8f+  , 0x5c007b8a+  , 0x58c1663d+  , 0x558240e4+  , 0x51435d53+  , 0x251d3b9e+  , 0x21dc2629+  , 0x2c9f00f0+  , 0x285e1d47+  , 0x36194d42+  , 0x32d850f5+  , 0x3f9b762c+  , 0x3b5a6b9b+  , 0x0315d626+  , 0x07d4cb91+  , 0x0a97ed48+  , 0x0e56f0ff+  , 0x1011a0fa+  , 0x14d0bd4d+  , 0x19939b94+  , 0x1d528623+  , 0xf12f560e+  , 0xf5ee4bb9+  , 0xf8ad6d60+  , 0xfc6c70d7+  , 0xe22b20d2+  , 0xe6ea3d65+  , 0xeba91bbc+  , 0xef68060b+  , 0xd727bbb6+  , 0xd3e6a601+  , 0xdea580d8+  , 0xda649d6f+  , 0xc423cd6a+  , 0xc0e2d0dd+  , 0xcda1f604+  , 0xc960ebb3+  , 0xbd3e8d7e+  , 0xb9ff90c9+  , 0xb4bcb610+  , 0xb07daba7+  , 0xae3afba2+  , 0xaafbe615+  , 0xa7b8c0cc+  , 0xa379dd7b+  , 0x9b3660c6+  , 0x9ff77d71+  , 0x92b45ba8+  , 0x9675461f+  , 0x8832161a+  , 0x8cf30bad+  , 0x81b02d74+  , 0x857130c3+  , 0x5d8a9099+  , 0x594b8d2e+  , 0x5408abf7+  , 0x50c9b640+  , 0x4e8ee645+  , 0x4a4ffbf2+  , 0x470cdd2b+  , 0x43cdc09c+  , 0x7b827d21+  , 0x7f436096+  , 0x7200464f+  , 0x76c15bf8+  , 0x68860bfd+  , 0x6c47164a+  , 0x61043093+  , 0x65c52d24+  , 0x119b4be9+  , 0x155a565e+  , 0x18197087+  , 0x1cd86d30+  , 0x029f3d35+  , 0x065e2082+  , 0x0b1d065b+  , 0x0fdc1bec+  , 0x3793a651+  , 0x3352bbe6+  , 0x3e119d3f+  , 0x3ad08088+  , 0x2497d08d+  , 0x2056cd3a+  , 0x2d15ebe3+  , 0x29d4f654+  , 0xc5a92679+  , 0xc1683bce+  , 0xcc2b1d17+  , 0xc8ea00a0+  , 0xd6ad50a5+  , 0xd26c4d12+  , 0xdf2f6bcb+  , 0xdbee767c+  , 0xe3a1cbc1+  , 0xe760d676+  , 0xea23f0af+  , 0xeee2ed18+  , 0xf0a5bd1d+  , 0xf464a0aa+  , 0xf9278673+  , 0xfde69bc4+  , 0x89b8fd09+  , 0x8d79e0be+  , 0x803ac667+  , 0x84fbdbd0+  , 0x9abc8bd5+  , 0x9e7d9662+  , 0x933eb0bb+  , 0x97ffad0c+  , 0xafb010b1+  , 0xab710d06+  , 0xa6322bdf+  , 0xa2f33668+  , 0xbcb4666d+  , 0xb8757bda+  , 0xb5365d03+  , 0xb1f740b4   ]
library/Rattletrap/Decode/AppliedDamageAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.AppliedDamageAttribute   ( decodeAppliedDamageAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int32le@@ -8,7 +9,8 @@ import Rattletrap.Decode.Word8le import Rattletrap.Type.AppliedDamageAttribute -decodeAppliedDamageAttributeBits :: (Int, Int, Int) -> DecodeBits AppliedDamageAttribute+decodeAppliedDamageAttributeBits+  :: (Int, Int, Int) -> DecodeBits AppliedDamageAttribute decodeAppliedDamageAttributeBits version =   AppliedDamageAttribute     <$> decodeWord8leBits
library/Rattletrap/Decode/Attribute.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Attribute   ( decodeAttributesBits   , decodeAttributeBits-  ) where+  )+where  import Data.Semigroup ((<>)) import Rattletrap.Decode.AttributeValue
library/Rattletrap/Decode/AttributeMapping.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.AttributeMapping   ( decodeAttributeMapping-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le
library/Rattletrap/Decode/AttributeValue.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.AttributeValue   ( decodeAttributeValueBits-  ) where+  )+where  import Data.Semigroup ((<>)) import Rattletrap.Data
library/Rattletrap/Decode/Bitstream.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Bitstream   ( decodeBitstreamBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Bitstream
library/Rattletrap/Decode/BooleanAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.BooleanAttribute   ( decodeBooleanAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.BooleanAttribute
library/Rattletrap/Decode/ByteAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.ByteAttribute   ( decodeByteAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word8le
library/Rattletrap/Decode/Cache.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Cache   ( decodeCache-  ) where+  )+where  import Rattletrap.Decode.AttributeMapping import Rattletrap.Decode.Common
library/Rattletrap/Decode/CamSettingsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.CamSettingsAttribute   ( decodeCamSettingsAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Float32le
library/Rattletrap/Decode/ClassMapping.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.ClassMapping   ( decodeClassMapping-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Str
library/Rattletrap/Decode/ClubColorsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.ClubColorsAttribute   ( decodeClubColorsAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word8le
library/Rattletrap/Decode/Common.hs view
@@ -2,13 +2,13 @@   ( Decode   , DecodeBits   , decodeWhen-  , getLazyByteStringBits+  , getByteStringBits   , getWord8Bits   , runDecode   , runDecodeBits   , toBits   , Binary.getFloatle-  , Binary.getLazyByteString+  , Binary.getByteString   , Binary.getInt8   , Binary.getInt32le   , Binary.getInt64le@@ -18,12 +18,14 @@   , BinaryBits.getBool   , BinaryBits.getWord16be   , BinaryBits.getWord32be-  ) where+  )+where  import qualified Control.Applicative as Applicative import qualified Data.Binary as Binary import qualified Data.Binary.Bits.Get as BinaryBits import qualified Data.Binary.Get as Binary+import qualified Data.ByteString as Bytes import qualified Data.ByteString.Lazy as LazyBytes import qualified Data.Word as Word import qualified Rattletrap.Utility.Bytes as Utility@@ -36,21 +38,22 @@   :: (Applicative m, Applicative.Alternative f) => Bool -> m a -> m (f a) decodeWhen p f = if p then fmap pure f else pure Applicative.empty -getLazyByteStringBits :: Int -> DecodeBits LazyBytes.ByteString-getLazyByteStringBits = BinaryBits.getLazyByteString+getByteStringBits :: Int -> DecodeBits Bytes.ByteString+getByteStringBits = BinaryBits.getByteString  getWord8Bits :: Int -> DecodeBits Word.Word8 getWord8Bits = BinaryBits.getWord8 -runDecode :: Decode a -> LazyBytes.ByteString -> Either String a-runDecode decode bytes = case Binary.runGetOrFail decode bytes of-  Left (_, _, x) -> fail x-  Right (_, _, x) -> pure x+runDecode :: Decode a -> Bytes.ByteString -> Either String a+runDecode decode bytes =+  case Binary.runGetOrFail decode (LazyBytes.fromStrict bytes) of+    Left (_, _, x) -> fail x+    Right (_, _, x) -> pure x -runDecodeBits :: DecodeBits a -> LazyBytes.ByteString -> Either String a+runDecodeBits :: DecodeBits a -> Bytes.ByteString -> Either String a runDecodeBits = runDecode . BinaryBits.runBitGet  toBits :: Decode a -> Int -> DecodeBits a toBits decode =-  fmap (Binary.runGet decode . Utility.reverseBytes)-    . BinaryBits.getLazyByteString+  fmap (Binary.runGet decode . LazyBytes.fromStrict . Utility.reverseBytes)+    . BinaryBits.getByteString
library/Rattletrap/Decode/CompressedWord.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.CompressedWord   ( decodeCompressedWordBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.CompressedWord
library/Rattletrap/Decode/CompressedWordVector.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.CompressedWordVector   ( decodeCompressedWordVectorBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.CompressedWord
library/Rattletrap/Decode/Content.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Content   ( decodeContent-  ) where+  )+where  import Rattletrap.Decode.Cache import Rattletrap.Decode.ClassMapping@@ -37,7 +38,7 @@     <*> decodeWord32le   (stream, messages, marks, packages, objects, names, classMappings, caches) <-     (,,,,,,,)-    <$> getLazyByteString (fromIntegral (word32leValue streamSize))+    <$> getByteString (fromIntegral (word32leValue streamSize))     <*> decodeList decodeMessage     <*> decodeList decodeMark     <*> decodeList decodeStr@@ -53,7 +54,7 @@       mempty   frames <- either fail pure (runDecodeBits bitGet (reverseBytes stream))   pure-    ( Content+    (Content       levels       keyFrames       streamSize
library/Rattletrap/Decode/DamageStateAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.DamageStateAttribute   ( decodeDamageStateAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int32le@@ -8,7 +9,8 @@ import Rattletrap.Decode.Word8le import Rattletrap.Type.DamageStateAttribute -decodeDamageStateAttributeBits :: (Int, Int, Int) -> DecodeBits DamageStateAttribute+decodeDamageStateAttributeBits+  :: (Int, Int, Int) -> DecodeBits DamageStateAttribute decodeDamageStateAttributeBits version =   DamageStateAttribute     <$> decodeWord8leBits
library/Rattletrap/Decode/DemolishAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.DemolishAttribute   ( decodeDemolishAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Vector
library/Rattletrap/Decode/DestroyedReplication.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.DestroyedReplication   ( decodeDestroyedReplicationBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.DestroyedReplication
library/Rattletrap/Decode/Dictionary.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Dictionary   ( decodeDictionary-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Str
library/Rattletrap/Decode/EnumAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.EnumAttribute   ( decodeEnumAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.EnumAttribute
library/Rattletrap/Decode/ExplosionAttribute.hs view
@@ -1,12 +1,17 @@ module Rattletrap.Decode.ExplosionAttribute   ( decodeExplosionAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int32le import Rattletrap.Decode.Vector import Rattletrap.Type.ExplosionAttribute -decodeExplosionAttributeBits :: (Int, Int, Int) -> DecodeBits ExplosionAttribute+decodeExplosionAttributeBits+  :: (Int, Int, Int) -> DecodeBits ExplosionAttribute decodeExplosionAttributeBits version =-  ExplosionAttribute <$> getBool <*> decodeInt32leBits <*> decodeVectorBits version+  ExplosionAttribute+    <$> getBool+    <*> decodeInt32leBits+    <*> decodeVectorBits version
library/Rattletrap/Decode/ExtendedExplosionAttribute.hs view
@@ -1,13 +1,15 @@ module Rattletrap.Decode.ExtendedExplosionAttribute   ( decodeExtendedExplosionAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.ExplosionAttribute import Rattletrap.Decode.FlaggedIntAttribute import Rattletrap.Type.ExtendedExplosionAttribute -decodeExtendedExplosionAttributeBits :: (Int, Int, Int) -> DecodeBits ExtendedExplosionAttribute+decodeExtendedExplosionAttributeBits+  :: (Int, Int, Int) -> DecodeBits ExtendedExplosionAttribute decodeExtendedExplosionAttributeBits version =   ExtendedExplosionAttribute     <$> decodeExplosionAttributeBits version
library/Rattletrap/Decode/FlaggedIntAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.FlaggedIntAttribute   ( decodeFlaggedIntAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int32le
library/Rattletrap/Decode/Float32le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Float32le   ( decodeFloat32le   , decodeFloat32leBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Float32le
library/Rattletrap/Decode/FloatAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.FloatAttribute   ( decodeFloatAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Float32le
library/Rattletrap/Decode/Frame.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Frame   ( decodeFramesBits   , decodeFrameBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Float32le
library/Rattletrap/Decode/GameModeAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.GameModeAttribute   ( decodeGameModeAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.GameModeAttribute
library/Rattletrap/Decode/Header.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Header   ( decodeHeader-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Dictionary
library/Rattletrap/Decode/Initialization.hs view
@@ -1,13 +1,15 @@ module Rattletrap.Decode.Initialization   ( decodeInitializationBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int8Vector import Rattletrap.Decode.Vector import Rattletrap.Type.Initialization -decodeInitializationBits :: (Int, Int, Int) -> Bool -> Bool -> DecodeBits Initialization+decodeInitializationBits+  :: (Int, Int, Int) -> Bool -> Bool -> DecodeBits Initialization decodeInitializationBits version hasLocation hasRotation =   Initialization     <$> decodeWhen hasLocation (decodeVectorBits version)
library/Rattletrap/Decode/Int32le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Int32le   ( decodeInt32le   , decodeInt32leBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Int32le
library/Rattletrap/Decode/Int64Attribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Int64Attribute   ( decodeInt64AttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int64le
library/Rattletrap/Decode/Int64le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Int64le   ( decodeInt64le   , decodeInt64leBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Int64le
library/Rattletrap/Decode/Int8Vector.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Int8Vector   ( decodeInt8VectorBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int8le
library/Rattletrap/Decode/Int8le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Int8le   ( decodeInt8le   , decodeInt8leBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Int8le
library/Rattletrap/Decode/IntAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.IntAttribute   ( decodeIntAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int32le
library/Rattletrap/Decode/KeyFrame.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.KeyFrame   ( decodeKeyFrame-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Float32le
library/Rattletrap/Decode/List.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.List   ( decodeList-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le
library/Rattletrap/Decode/LoadoutAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.LoadoutAttribute   ( decodeLoadoutAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le
library/Rattletrap/Decode/LoadoutOnlineAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.LoadoutOnlineAttribute   ( decodeLoadoutOnlineAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.ProductAttribute
library/Rattletrap/Decode/LoadoutsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.LoadoutsAttribute   ( decodeLoadoutsAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.LoadoutAttribute
library/Rattletrap/Decode/LoadoutsOnlineAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.LoadoutsOnlineAttribute   ( decodeLoadoutsOnlineAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.LoadoutOnlineAttribute
library/Rattletrap/Decode/LocationAttribute.hs view
@@ -1,10 +1,12 @@ module Rattletrap.Decode.LocationAttribute   ( decodeLocationAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Vector import Rattletrap.Type.LocationAttribute  decodeLocationAttributeBits :: (Int, Int, Int) -> DecodeBits LocationAttribute-decodeLocationAttributeBits version = LocationAttribute <$> decodeVectorBits version+decodeLocationAttributeBits version =+  LocationAttribute <$> decodeVectorBits version
library/Rattletrap/Decode/Mark.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Mark   ( decodeMark-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Str
library/Rattletrap/Decode/Message.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Message   ( decodeMessage-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Str
library/Rattletrap/Decode/MusicStingerAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.MusicStingerAttribute   ( decodeMusicStingerAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le
library/Rattletrap/Decode/PartyLeaderAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.PartyLeaderAttribute   ( decodePartyLeaderAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.RemoteId
library/Rattletrap/Decode/PickupAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.PickupAttribute   ( decodePickupAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le
library/Rattletrap/Decode/PlayerHistoryKeyAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.PlayerHistoryKeyAttribute   ( decodePlayerHistoryKeyAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Bitstream import Rattletrap.Decode.Common
library/Rattletrap/Decode/PrivateMatchSettingsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.PrivateMatchSettingsAttribute   ( decodePrivateMatchSettingsAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Str
library/Rattletrap/Decode/ProductAttribute.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.ProductAttribute   ( decodeProductAttributesBits   , decodeProductAttributeBits-  ) where+  )+where  import Data.Semigroup ((<>)) import Rattletrap.Decode.Common
library/Rattletrap/Decode/Property.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Property   ( decodeProperty-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.PropertyValue
library/Rattletrap/Decode/PropertyValue.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.PropertyValue   ( decodePropertyValue-  ) where+  )+where  import Data.Semigroup ((<>)) import Rattletrap.Decode.Common
library/Rattletrap/Decode/QWordAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.QWordAttribute   ( decodeQWordAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word64le
library/Rattletrap/Decode/RemoteId.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.RemoteId   ( decodeRemoteIdBits-  ) where+  )+where  import Data.Semigroup ((<>)) import Rattletrap.Decode.Bitstream@@ -10,7 +11,7 @@ import Rattletrap.Type.Word8le import Rattletrap.Utility.Bytes -import qualified Data.ByteString.Lazy as LazyBytes+import qualified Data.ByteString as Bytes import qualified Data.Text as Text import qualified Data.Text.Encoding as Text import qualified Data.Word as Word@@ -26,13 +27,9 @@  decodePsName :: DecodeBits Text.Text decodePsName = fmap-  ( Text.dropWhileEnd (== '\x00')-  . Text.decodeLatin1-  . LazyBytes.toStrict-  . reverseBytes-  )-  (getLazyByteStringBits 16)+  (Text.dropWhileEnd (== '\x00') . Text.decodeLatin1 . reverseBytes)+  (getByteStringBits 16)  decodePsBytes :: Int -> DecodeBits [Word.Word8] decodePsBytes patch =-  LazyBytes.unpack <$> getLazyByteStringBits (if patch >= 1 then 24 else 16)+  Bytes.unpack <$> getByteStringBits (if patch >= 1 then 24 else 16)
library/Rattletrap/Decode/Replay.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Replay   ( decodeReplay-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Content@@ -20,7 +21,7 @@ decodeReplay = do   header <- decodeSection decodeHeader   Replay header <$> decodeSection-    ( decodeContent+    (decodeContent       (getVersion (sectionBody header))       (getNumFrames (sectionBody header))       (getMaxChannels (sectionBody header))
library/Rattletrap/Decode/Replication.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Replication   ( decodeReplicationsBits   , decodeReplicationBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.CompressedWord
library/Rattletrap/Decode/ReplicationValue.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.ReplicationValue   ( decodeReplicationValueBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.DestroyedReplication@@ -34,7 +35,7 @@           ReplicationValueSpawned             <$> decodeSpawnedReplicationBits version classAttributeMap actorId         else ReplicationValueUpdated <$> Trans.lift-          ( decodeUpdatedReplicationBits+          (decodeUpdatedReplicationBits             version             classAttributeMap             actorMap
library/Rattletrap/Decode/ReservationAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.ReservationAttribute   ( decodeReservationAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.CompressedWord
library/Rattletrap/Decode/RigidBodyStateAttribute.hs view
@@ -1,13 +1,15 @@ module Rattletrap.Decode.RigidBodyStateAttribute   ( decodeRigidBodyStateAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Rotation import Rattletrap.Decode.Vector import Rattletrap.Type.RigidBodyStateAttribute -decodeRigidBodyStateAttributeBits :: (Int, Int, Int) -> DecodeBits RigidBodyStateAttribute+decodeRigidBodyStateAttributeBits+  :: (Int, Int, Int) -> DecodeBits RigidBodyStateAttribute decodeRigidBodyStateAttributeBits version = do   sleeping <- getBool   RigidBodyStateAttribute sleeping
library/Rattletrap/Decode/Section.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Section   ( decodeSection-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le@@ -14,7 +15,7 @@ decodeSection getBody = do   size <- decodeWord32le   crc <- decodeWord32le-  rawBody <- getLazyByteString (fromIntegral (word32leValue size))+  rawBody <- getByteString (fromIntegral (word32leValue size))   let actualCrc = Word32le (getCrc32 rawBody)   Monad.when (actualCrc /= crc) (fail (crcMessage actualCrc crc))   body <- either fail pure (runDecode getBody rawBody)
library/Rattletrap/Decode/SpawnedReplication.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.SpawnedReplication   ( decodeSpawnedReplicationBits-  ) where+  )+where  import Data.Semigroup ((<>)) import Rattletrap.Decode.Common@@ -39,7 +40,7 @@   initialization <- Trans.lift     (decodeInitializationBits version hasLocation hasRotation)   pure-    ( SpawnedReplication+    (SpawnedReplication       flag       nameIndex       name
library/Rattletrap/Decode/StatEventAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.StatEventAttribute   ( decodeStatEventAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int32le@@ -8,6 +9,4 @@  decodeStatEventAttributeBits :: DecodeBits StatEventAttribute decodeStatEventAttributeBits =-  StatEventAttribute-    <$> getBool-    <*> decodeInt32leBits+  StatEventAttribute <$> getBool <*> decodeInt32leBits
library/Rattletrap/Decode/Str.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Str   ( decodeStr   , decodeStrBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Int32le@@ -9,20 +10,20 @@ import Rattletrap.Type.Str import Rattletrap.Utility.Bytes -import qualified Data.ByteString.Lazy as LazyBytes+import qualified Data.ByteString as Bytes import qualified Data.Text as Text import qualified Data.Text.Encoding as Text  decodeStr :: Decode Str decodeStr = do   rawSize <- decodeInt32le-  bytes <- getLazyByteString (normalizeTextSize rawSize)+  bytes <- getByteString (normalizeTextSize rawSize)   pure (Str (dropNull (getTextDecoder rawSize bytes)))  decodeStrBits :: DecodeBits Str decodeStrBits = do   rawSize <- decodeInt32leBits-  bytes <- getLazyByteStringBits (normalizeTextSize rawSize)+  bytes <- getByteStringBits (normalizeTextSize rawSize)   pure (Str (dropNull (getTextDecoder rawSize (reverseBytes bytes))))  normalizeTextSize :: Integral a => Int32le -> a@@ -30,13 +31,12 @@   0x05000000 -> 8   x -> if x < 0 then (-2 * fromIntegral x) else fromIntegral x -getTextDecoder :: Int32le -> LazyBytes.ByteString -> Text.Text+getTextDecoder :: Int32le -> Bytes.ByteString -> Text.Text getTextDecoder size bytes =   let     decode =       if size < Int32le 0 then Text.decodeUtf16LE else Text.decodeLatin1-  in-    decode (LazyBytes.toStrict bytes)+  in decode bytes  dropNull :: Text.Text -> Text.Text dropNull = Text.dropWhileEnd (== '\x00')
library/Rattletrap/Decode/StringAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.StringAttribute   ( decodeStringAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Str
library/Rattletrap/Decode/TeamPaintAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.TeamPaintAttribute   ( decodeTeamPaintAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le
library/Rattletrap/Decode/TitleAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.TitleAttribute   ( decodeTitleAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Word32le
library/Rattletrap/Decode/UniqueIdAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.UniqueIdAttribute   ( decodeUniqueIdAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.RemoteId
library/Rattletrap/Decode/UpdatedReplication.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.UpdatedReplication   ( decodeUpdatedReplicationBits-  ) where+  )+where  import Rattletrap.Decode.Attribute import Rattletrap.Decode.Common
library/Rattletrap/Decode/Vector.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.Vector   ( decodeVectorBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.CompressedWord
library/Rattletrap/Decode/WeldedInfoAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Decode.WeldedInfoAttribute   ( decodeWeldedInfoAttributeBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Float32le@@ -9,7 +10,8 @@ import Rattletrap.Decode.Vector import Rattletrap.Type.WeldedInfoAttribute -decodeWeldedInfoAttributeBits :: (Int, Int, Int) -> DecodeBits WeldedInfoAttribute+decodeWeldedInfoAttributeBits+  :: (Int, Int, Int) -> DecodeBits WeldedInfoAttribute decodeWeldedInfoAttributeBits version =   WeldedInfoAttribute     <$> getBool
library/Rattletrap/Decode/Word32le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Word32le   ( decodeWord32le   , decodeWord32leBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Word32le
library/Rattletrap/Decode/Word64le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Word64le   ( decodeWord64le   , decodeWord64leBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Word64le
library/Rattletrap/Decode/Word8le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Decode.Word8le   ( decodeWord8le   , decodeWord8leBits-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Type.Word8le
library/Rattletrap/Encode/AppliedDamageAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.AppliedDamageAttribute   ( putAppliedDamageAttribute-  ) where+  )+where  import Rattletrap.Encode.Int32le import Rattletrap.Encode.Vector
library/Rattletrap/Encode/Attribute.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Attribute   ( putAttributes   , putAttribute-  ) where+  )+where  import Rattletrap.Encode.AttributeValue import Rattletrap.Encode.CompressedWord
library/Rattletrap/Encode/AttributeMapping.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.AttributeMapping   ( putAttributeMapping-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Type.AttributeMapping
library/Rattletrap/Encode/AttributeValue.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.AttributeValue   ( putAttributeValue-  ) where+  )+where  import Rattletrap.Encode.AppliedDamageAttribute import Rattletrap.Encode.BooleanAttribute
library/Rattletrap/Encode/Bitstream.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Bitstream   ( putBitstream-  ) where+  )+where  import Rattletrap.Type.Bitstream 
library/Rattletrap/Encode/BooleanAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.BooleanAttribute   ( putBooleanAttribute-  ) where+  )+where  import Rattletrap.Type.BooleanAttribute 
library/Rattletrap/Encode/ByteAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.ByteAttribute   ( putByteAttribute-  ) where+  )+where  import Rattletrap.Encode.Word8le import Rattletrap.Type.ByteAttribute
library/Rattletrap/Encode/Cache.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Cache   ( putCache-  ) where+  )+where  import Rattletrap.Encode.AttributeMapping import Rattletrap.Encode.List
library/Rattletrap/Encode/CamSettingsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.CamSettingsAttribute   ( putCamSettingsAttribute-  ) where+  )+where  import Rattletrap.Encode.Float32le import Rattletrap.Type.CamSettingsAttribute
library/Rattletrap/Encode/ClassMapping.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.ClassMapping   ( putClassMapping-  ) where+  )+where  import Rattletrap.Encode.Str import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/ClubColorsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.ClubColorsAttribute   ( putClubColorsAttribute-  ) where+  )+where  import Rattletrap.Encode.Word8le import Rattletrap.Type.ClubColorsAttribute
library/Rattletrap/Encode/CompressedWord.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.CompressedWord   ( putCompressedWord-  ) where+  )+where  import Rattletrap.Type.CompressedWord 
library/Rattletrap/Encode/CompressedWordVector.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.CompressedWordVector   ( putCompressedWordVector-  ) where+  )+where  import Rattletrap.Encode.CompressedWord import Rattletrap.Type.CompressedWordVector
library/Rattletrap/Encode/Content.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Content   ( putContent-  ) where+  )+where  import Rattletrap.Encode.Cache import Rattletrap.Encode.ClassMapping@@ -18,6 +19,7 @@ import qualified Data.Binary as Binary import qualified Data.Binary.Bits.Put as BinaryBits import qualified Data.Binary.Put as Binary+import qualified Data.ByteString.Lazy as LazyBytes  putContent :: Content -> Binary.Put putContent content = do@@ -26,9 +28,10 @@   let streamSize = contentStreamSize content   putWord32 streamSize   let-    stream =-      Binary.runPut (BinaryBits.runBitPut (putFrames (contentFrames content)))-  Binary.putLazyByteString+    stream = LazyBytes.toStrict+      (Binary.runPut (BinaryBits.runBitPut (putFrames (contentFrames content)))+      )+  Binary.putByteString     (reverseBytes (padBytes (word32leValue streamSize) stream))   putList putMessage (contentMessages content)   putList putMark (contentMarks content)
library/Rattletrap/Encode/DamageStateAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.DamageStateAttribute   ( putDamageStateAttribute-  ) where+  )+where  import Rattletrap.Encode.Int32le import Rattletrap.Encode.Vector
library/Rattletrap/Encode/DemolishAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.DemolishAttribute   ( putDemolishAttribute-  ) where+  )+where  import Rattletrap.Encode.Vector import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/DestroyedReplication.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.DestroyedReplication   ( putDestroyedReplication-  ) where+  )+where  import Rattletrap.Type.DestroyedReplication 
library/Rattletrap/Encode/Dictionary.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Dictionary   ( putDictionary-  ) where+  )+where  import Rattletrap.Encode.Str import Rattletrap.Type.Dictionary
library/Rattletrap/Encode/EnumAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.EnumAttribute   ( putEnumAttribute-  ) where+  )+where  import Rattletrap.Type.EnumAttribute 
library/Rattletrap/Encode/ExplosionAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.ExplosionAttribute   ( putExplosionAttribute-  ) where+  )+where  import Rattletrap.Encode.Int32le import Rattletrap.Encode.Vector
library/Rattletrap/Encode/ExtendedExplosionAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.ExtendedExplosionAttribute   ( putExtendedExplosionAttribute-  ) where+  )+where  import Rattletrap.Encode.ExplosionAttribute import Rattletrap.Encode.FlaggedIntAttribute
library/Rattletrap/Encode/FlaggedIntAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.FlaggedIntAttribute   ( putFlaggedIntAttribute-  ) where+  )+where  import Rattletrap.Encode.Int32le import Rattletrap.Type.FlaggedIntAttribute
library/Rattletrap/Encode/Float32le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Float32le   ( putFloat32   , putFloat32Bits-  ) where+  )+where  import Rattletrap.Type.Float32le import Rattletrap.Utility.Bytes@@ -16,5 +17,5 @@  putFloat32Bits :: Float32le -> BinaryBits.BitPut () putFloat32Bits float32 = do-  let bytes = Binary.runPut (putFloat32 float32)-  BinaryBits.putByteString (LazyBytes.toStrict (reverseBytes bytes))+  let bytes = LazyBytes.toStrict (Binary.runPut (putFloat32 float32))+  BinaryBits.putByteString (reverseBytes bytes)
library/Rattletrap/Encode/FloatAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.FloatAttribute   ( putFloatAttribute-  ) where+  )+where  import Rattletrap.Encode.Float32le import Rattletrap.Type.FloatAttribute
library/Rattletrap/Encode/Frame.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Frame   ( putFrames   , putFrame-  ) where+  )+where  import Rattletrap.Encode.Float32le import Rattletrap.Encode.Replication
library/Rattletrap/Encode/GameModeAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.GameModeAttribute   ( putGameModeAttribute-  ) where+  )+where  import Rattletrap.Type.GameModeAttribute 
library/Rattletrap/Encode/Header.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Header   ( putHeader-  ) where+  )+where  import Rattletrap.Encode.Dictionary import Rattletrap.Encode.Property
library/Rattletrap/Encode/Initialization.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Initialization   ( putInitialization-  ) where+  )+where  import Rattletrap.Encode.Int8Vector import Rattletrap.Encode.Vector
library/Rattletrap/Encode/Int32le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Int32le   ( putInt32   , putInt32Bits-  ) where+  )+where  import Rattletrap.Type.Int32le import Rattletrap.Utility.Bytes@@ -16,5 +17,5 @@  putInt32Bits :: Int32le -> BinaryBits.BitPut () putInt32Bits int32 = do-  let bytes = Binary.runPut (putInt32 int32)-  BinaryBits.putByteString (LazyBytes.toStrict (reverseBytes bytes))+  let bytes = LazyBytes.toStrict (Binary.runPut (putInt32 int32))+  BinaryBits.putByteString (reverseBytes bytes)
library/Rattletrap/Encode/Int64Attribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Int64Attribute   ( putInt64Attribute-  ) where+  )+where  import Rattletrap.Encode.Int64le import Rattletrap.Type.Int64Attribute
library/Rattletrap/Encode/Int64le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Int64le   ( putInt64   , putInt64Bits-  ) where+  )+where  import Rattletrap.Type.Int64le import Rattletrap.Utility.Bytes@@ -16,5 +17,5 @@  putInt64Bits :: Int64le -> BinaryBits.BitPut () putInt64Bits int64 = do-  let bytes = Binary.runPut (putInt64 int64)-  BinaryBits.putByteString (LazyBytes.toStrict (reverseBytes bytes))+  let bytes = LazyBytes.toStrict (Binary.runPut (putInt64 int64))+  BinaryBits.putByteString (reverseBytes bytes)
library/Rattletrap/Encode/Int8Vector.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Int8Vector   ( putInt8Vector-  ) where+  )+where  import Rattletrap.Encode.Int8le import Rattletrap.Type.Int8Vector
library/Rattletrap/Encode/Int8le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Int8le   ( putInt8   , putInt8Bits-  ) where+  )+where  import Rattletrap.Type.Int8le import Rattletrap.Utility.Bytes@@ -15,5 +16,5 @@  putInt8Bits :: Int8le -> BinaryBits.BitPut () putInt8Bits int8 = do-  let bytes = Binary.runPut (putInt8 int8)-  BinaryBits.putByteString (LazyBytes.toStrict (reverseBytes bytes))+  let bytes = LazyBytes.toStrict (Binary.runPut (putInt8 int8))+  BinaryBits.putByteString (reverseBytes bytes)
library/Rattletrap/Encode/IntAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.IntAttribute   ( putIntAttribute-  ) where+  )+where  import Rattletrap.Encode.Int32le import Rattletrap.Type.IntAttribute
library/Rattletrap/Encode/KeyFrame.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.KeyFrame   ( putKeyFrame-  ) where+  )+where  import Rattletrap.Encode.Float32le import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/List.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.List   ( putList-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Type.List
library/Rattletrap/Encode/LoadoutAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.LoadoutAttribute   ( putLoadoutAttribute-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Encode.Word8le
library/Rattletrap/Encode/LoadoutOnlineAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.LoadoutOnlineAttribute   ( putLoadoutOnlineAttribute-  ) where+  )+where  import Rattletrap.Encode.ProductAttribute import Rattletrap.Encode.Word8le
library/Rattletrap/Encode/LoadoutsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.LoadoutsAttribute   ( putLoadoutsAttribute-  ) where+  )+where  import Rattletrap.Encode.LoadoutAttribute import Rattletrap.Type.LoadoutsAttribute
library/Rattletrap/Encode/LoadoutsOnlineAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.LoadoutsOnlineAttribute   ( putLoadoutsOnlineAttribute-  ) where+  )+where  import Rattletrap.Encode.LoadoutOnlineAttribute import Rattletrap.Type.LoadoutsOnlineAttribute
library/Rattletrap/Encode/LocationAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.LocationAttribute   ( putLocationAttribute-  ) where+  )+where  import Rattletrap.Encode.Vector import Rattletrap.Type.LocationAttribute
library/Rattletrap/Encode/Mark.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Mark   ( putMark-  ) where+  )+where  import Rattletrap.Encode.Str import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/Message.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Message   ( putMessage-  ) where+  )+where  import Rattletrap.Encode.Str import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/MusicStingerAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.MusicStingerAttribute   ( putMusicStingerAttribute-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Encode.Word8le
library/Rattletrap/Encode/PartyLeaderAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.PartyLeaderAttribute   ( putPartyLeaderAttribute-  ) where+  )+where  import Rattletrap.Encode.RemoteId import Rattletrap.Encode.Word8le
library/Rattletrap/Encode/PickupAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.PickupAttribute   ( putPickupAttribute-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Type.PickupAttribute
library/Rattletrap/Encode/PlayerHistoryKeyAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.PlayerHistoryKeyAttribute   ( putPlayerHistoryKeyAttribute-  ) where+  )+where  import Rattletrap.Encode.Bitstream import Rattletrap.Type.PlayerHistoryKeyAttribute
library/Rattletrap/Encode/PrivateMatchSettingsAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.PrivateMatchSettingsAttribute   ( putPrivateMatchSettingsAttribute-  ) where+  )+where  import Rattletrap.Encode.Str import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/ProductAttribute.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.ProductAttribute   ( putProductAttributes   , putProductAttribute-  ) where+  )+where  import Rattletrap.Encode.CompressedWord import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/Property.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Property   ( putProperty-  ) where+  )+where  import Rattletrap.Encode.PropertyValue import Rattletrap.Encode.Str
library/Rattletrap/Encode/PropertyValue.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.PropertyValue   ( putPropertyValue-  ) where+  )+where  import Rattletrap.Encode.Dictionary import Rattletrap.Encode.Float32le
library/Rattletrap/Encode/QWordAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.QWordAttribute   ( putQWordAttribute-  ) where+  )+where  import Rattletrap.Encode.Word64le import Rattletrap.Type.QWordAttribute
library/Rattletrap/Encode/RemoteId.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.RemoteId   ( putRemoteId-  ) where+  )+where  import Rattletrap.Encode.Bitstream import Rattletrap.Encode.Word64le@@ -8,16 +9,14 @@ import Rattletrap.Utility.Bytes  import qualified Data.Binary.Bits.Put as BinaryBits-import qualified Data.ByteString.Lazy as LazyBytes+import qualified Data.ByteString as Bytes  putRemoteId :: RemoteId -> BinaryBits.BitPut () putRemoteId remoteId = case remoteId of   RemoteIdPlayStation name bytes -> do-    let-      rawName = LazyBytes.toStrict-        (reverseBytes (padBytes (16 :: Int) (encodeLatin1 name)))+    let rawName = reverseBytes (padBytes (16 :: Int) (encodeLatin1 name))     BinaryBits.putByteString rawName-    BinaryBits.putByteString (LazyBytes.toStrict (LazyBytes.pack bytes))+    BinaryBits.putByteString (Bytes.pack bytes)   RemoteIdSplitscreen word24 -> BinaryBits.putWord32be 24 word24   RemoteIdSteam word64 -> putWord64Bits word64   RemoteIdSwitch x -> putBitstream x
library/Rattletrap/Encode/Replay.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Replay   ( putReplay-  ) where+  )+where  import Rattletrap.Encode.Content import Rattletrap.Encode.Header
library/Rattletrap/Encode/Replication.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Replication   ( putReplications   , putReplication-  ) where+  )+where  import Rattletrap.Encode.CompressedWord import Rattletrap.Encode.ReplicationValue
library/Rattletrap/Encode/ReplicationValue.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.ReplicationValue   ( putReplicationValue-  ) where+  )+where  import Rattletrap.Encode.DestroyedReplication import Rattletrap.Encode.SpawnedReplication
library/Rattletrap/Encode/ReservationAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.ReservationAttribute   ( putReservationAttribute-  ) where+  )+where  import Rattletrap.Encode.CompressedWord import Rattletrap.Encode.Str
library/Rattletrap/Encode/RigidBodyStateAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.RigidBodyStateAttribute   ( putRigidBodyStateAttribute-  ) where+  )+where  import Rattletrap.Encode.Rotation import Rattletrap.Encode.Vector@@ -12,8 +13,7 @@ putRigidBodyStateAttribute rigidBodyStateAttribute = do   BinaryBits.putBool (rigidBodyStateAttributeSleeping rigidBodyStateAttribute)   putVector (rigidBodyStateAttributeLocation rigidBodyStateAttribute)-  putRotation-    (rigidBodyStateAttributeRotation rigidBodyStateAttribute)+  putRotation (rigidBodyStateAttributeRotation rigidBodyStateAttribute)   case rigidBodyStateAttributeLinearVelocity rigidBodyStateAttribute of     Nothing -> pure ()     Just linearVelocity -> putVector linearVelocity
library/Rattletrap/Encode/Section.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Section   ( putSection-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Type.Section@@ -9,6 +10,7 @@  import qualified Data.Binary as Binary import qualified Data.Binary.Put as Binary+import qualified Data.ByteString as Bytes import qualified Data.ByteString.Lazy as LazyBytes  -- | Given a way to put the 'sectionBody', puts a section. This will also put@@ -19,9 +21,11 @@ -- @ putSection :: (a -> Binary.Put) -> Section a -> Binary.Put putSection putBody section = do-  let rawBody = Binary.runPut (putBody (sectionBody section))-  let size = LazyBytes.length rawBody+  let+    rawBody =+      LazyBytes.toStrict (Binary.runPut (putBody (sectionBody section)))+  let size = Bytes.length rawBody   let crc = getCrc32 rawBody   putWord32 (Word32le (fromIntegral size))   putWord32 (Word32le crc)-  Binary.putLazyByteString rawBody+  Binary.putByteString rawBody
library/Rattletrap/Encode/SpawnedReplication.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.SpawnedReplication   ( putSpawnedReplication-  ) where+  )+where  import Rattletrap.Encode.Initialization import Rattletrap.Encode.Word32le
library/Rattletrap/Encode/StatEventAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.StatEventAttribute   ( putStatEventAttribute-  ) where+  )+where  import Rattletrap.Encode.Int32le import Rattletrap.Type.StatEventAttribute
library/Rattletrap/Encode/Str.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Str   ( putText   , putTextBits-  ) where+  )+where  import Rattletrap.Encode.Int32le import Rattletrap.Type.Common@@ -12,7 +13,7 @@ import qualified Data.Binary as Binary import qualified Data.Binary.Bits.Put as BinaryBits import qualified Data.Binary.Put as Binary-import qualified Data.ByteString.Lazy as LazyBytes+import qualified Data.ByteString as Bytes import qualified Data.Char as Char import qualified Data.Text as Text import qualified Data.Text.Encoding as Text@@ -22,15 +23,14 @@   let size = getTextSize text   let encode = getTextEncoder size   putInt32 size-  Binary.putLazyByteString (encode (addNull (strValue text)))+  Binary.putByteString (encode (addNull (strValue text)))  putTextBits :: Str -> BinaryBits.BitPut () putTextBits text = do   let size = getTextSize text   let encode = getTextEncoder size   putInt32Bits size-  BinaryBits.putByteString-    (LazyBytes.toStrict (reverseBytes (encode (addNull (strValue text)))))+  BinaryBits.putByteString (reverseBytes (encode (addNull (strValue text))))  getTextSize :: Str -> Int32le getTextSize text =@@ -46,10 +46,9 @@   in     Int32le size -getTextEncoder :: Int32le -> Text.Text -> LazyBytes.ByteString-getTextEncoder size text = if size < Int32le 0-  then LazyBytes.fromStrict (Text.encodeUtf16LE text)-  else encodeLatin1 text+getTextEncoder :: Int32le -> Text.Text -> Bytes.ByteString+getTextEncoder size text =+  if size < Int32le 0 then Text.encodeUtf16LE text else encodeLatin1 text  addNull :: Text.Text -> Text.Text addNull text = if Text.null text then text else Text.snoc text '\x00'
library/Rattletrap/Encode/StringAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.StringAttribute   ( putStringAttribute-  ) where+  )+where  import Rattletrap.Encode.Str import Rattletrap.Type.StringAttribute
library/Rattletrap/Encode/TeamPaintAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.TeamPaintAttribute   ( putTeamPaintAttribute-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Encode.Word8le
library/Rattletrap/Encode/TitleAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.TitleAttribute   ( putTitleAttribute-  ) where+  )+where  import Rattletrap.Encode.Word32le import Rattletrap.Type.TitleAttribute
library/Rattletrap/Encode/UniqueIdAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.UniqueIdAttribute   ( putUniqueIdAttribute-  ) where+  )+where  import Rattletrap.Encode.RemoteId import Rattletrap.Encode.Word8le
library/Rattletrap/Encode/UpdatedReplication.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.UpdatedReplication   ( putUpdatedReplication-  ) where+  )+where  import Rattletrap.Encode.Attribute import Rattletrap.Type.UpdatedReplication
library/Rattletrap/Encode/Vector.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.Vector   ( putVector-  ) where+  )+where  import Rattletrap.Encode.CompressedWord import Rattletrap.Type.CompressedWord
library/Rattletrap/Encode/WeldedInfoAttribute.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Encode.WeldedInfoAttribute   ( putWeldedInfoAttribute-  ) where+  )+where  import Rattletrap.Encode.Float32le import Rattletrap.Encode.Int32le
library/Rattletrap/Encode/Word32le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Word32le   ( putWord32   , putWord32Bits-  ) where+  )+where  import Rattletrap.Type.Word32le import Rattletrap.Utility.Bytes@@ -16,5 +17,5 @@  putWord32Bits :: Word32le -> BinaryBits.BitPut () putWord32Bits word32 = do-  let bytes = Binary.runPut (putWord32 word32)-  BinaryBits.putByteString (LazyBytes.toStrict (reverseBytes bytes))+  let bytes = LazyBytes.toStrict (Binary.runPut (putWord32 word32))+  BinaryBits.putByteString (reverseBytes bytes)
library/Rattletrap/Encode/Word64le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Word64le   ( putWord64   , putWord64Bits-  ) where+  )+where  import Rattletrap.Type.Word64le import Rattletrap.Utility.Bytes@@ -16,5 +17,5 @@  putWord64Bits :: Word64le -> BinaryBits.BitPut () putWord64Bits word64 = do-  let bytes = Binary.runPut (putWord64 word64)-  BinaryBits.putByteString (LazyBytes.toStrict (reverseBytes bytes))+  let bytes = LazyBytes.toStrict (Binary.runPut (putWord64 word64))+  BinaryBits.putByteString (reverseBytes bytes)
library/Rattletrap/Encode/Word8le.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Encode.Word8le   ( putWord8   , putWord8Bits-  ) where+  )+where  import Rattletrap.Type.Word8le import Rattletrap.Utility.Bytes@@ -16,5 +17,5 @@  putWord8Bits :: Word8le -> BinaryBits.BitPut () putWord8Bits word8 = do-  let bytes = Binary.runPut (putWord8 word8)-  BinaryBits.putByteString (LazyBytes.toStrict (reverseBytes bytes))+  let bytes = LazyBytes.toStrict (Binary.runPut (putWord8 word8))+  BinaryBits.putByteString (reverseBytes bytes)
library/Rattletrap/Type/AppliedDamageAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.AppliedDamageAttribute   ( AppliedDamageAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int32le
library/Rattletrap/Type/Attribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Attribute   ( Attribute(..)-  ) where+  )+where  import Rattletrap.Type.AttributeValue import Rattletrap.Type.Common
library/Rattletrap/Type/AttributeMapping.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.AttributeMapping   ( AttributeMapping(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word32le
library/Rattletrap/Type/AttributeType.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.AttributeType   ( AttributeType(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/AttributeValue.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.AttributeValue   ( AttributeValue(..)-  ) where+  )+where  import Rattletrap.Type.AppliedDamageAttribute import Rattletrap.Type.BooleanAttribute
library/Rattletrap/Type/Bitstream.hs view
@@ -1,6 +1,7 @@ module Rattletrap.Type.Bitstream   ( Bitstream(..)-  ) where+  )+where  import qualified Data.Aeson as Json import qualified Data.Bool as Bool@@ -21,7 +22,7 @@               case char of                 '0' -> pure False                 '1' -> pure True-                _ -> fail ("invalid bit: " ++ show char))+                _ -> fail ("invalid bit: " <> show char))            (Text.unpack text))  instance Json.ToJSON Bitstream where
library/Rattletrap/Type/BooleanAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.BooleanAttribute   ( BooleanAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/ByteAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.ByteAttribute   ( ByteAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word8le
library/Rattletrap/Type/Cache.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Cache   ( Cache(..)-  ) where+  )+where  import Rattletrap.Type.AttributeMapping import Rattletrap.Type.Common
library/Rattletrap/Type/CamSettingsAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.CamSettingsAttribute   ( CamSettingsAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Float32le
library/Rattletrap/Type/ClassAttributeMap.hs view
@@ -9,7 +9,8 @@   , getName   , getObjectName   , makeClassAttributeMap-  ) where+  )+where  import Rattletrap.Data import Rattletrap.Type.AttributeMapping@@ -39,7 +40,7 @@   -- ^ A map from object IDs to their names.   , classAttributeMapObjectClassMap :: Map Word32le Word32le   -- ^ A map from object IDs to their class IDs.-  , classAttributeMapValue :: Map Word32le (Map Word32le Word32le)+    , classAttributeMapValue :: Map Word32le (Map Word32le Word32le)   -- ^ A map from class IDs to a map from attribute stream IDs to attribute   -- IDs.   , classAttributeMapNameMap :: IntMap.IntMap Str@@ -68,36 +69,36 @@   -> List Str   -- ^ From 'Rattletrap.Content.contentNames'.   -> ClassAttributeMap-makeClassAttributeMap objects classMappings caches names =-  let-    objectMap = makeObjectMap objects-    classMap = makeClassMap classMappings-    objectClassMap = makeObjectClassMap objectMap classMap-    classCache = makeClassCache classMap caches-    attributeMap = makeAttributeMap caches-    classIds = fmap (\(_, classId, _, _) -> classId) classCache-    parentMap = makeParentMap classCache-    value = Map.fromList-      ( fmap-        ( \classId ->-          let-            ownAttributes =-              Maybe.fromMaybe Map.empty (Map.lookup classId attributeMap)-            parentsAttributes = case Map.lookup classId parentMap of-              Nothing -> []-              Just parentClassIds -> fmap-                ( \parentClassId -> Maybe.fromMaybe-                  Map.empty-                  (Map.lookup parentClassId attributeMap)-                )-                parentClassIds-            attributes = ownAttributes : parentsAttributes-          in (classId, Map.fromList (concatMap Map.toList attributes))+makeClassAttributeMap objects classMappings caches names+  = let+      objectMap = makeObjectMap objects+      classMap = makeClassMap classMappings+      objectClassMap = makeObjectClassMap objectMap classMap+      classCache = makeClassCache classMap caches+      attributeMap = makeAttributeMap caches+      classIds = fmap (\(_, classId, _, _) -> classId) classCache+      parentMap = makeParentMap classCache+      value = Map.fromList+        (fmap+          (\classId ->+            let+              ownAttributes =+                Maybe.fromMaybe Map.empty (Map.lookup classId attributeMap)+              parentsAttributes = case Map.lookup classId parentMap of+                Nothing -> []+                Just parentClassIds -> fmap+                  (\parentClassId -> Maybe.fromMaybe+                    Map.empty+                    (Map.lookup parentClassId attributeMap)+                  )+                  parentClassIds+              attributes = ownAttributes : parentsAttributes+            in (classId, Map.fromList (concatMap Map.toList attributes))+          )+          classIds         )-        classIds-      )-    nameMap = makeNameMap names-  in ClassAttributeMap objectMap objectClassMap value nameMap+      nameMap = makeNameMap names+    in ClassAttributeMap objectMap objectClassMap value nameMap  makeNameMap :: List Str -> IntMap.IntMap Str makeNameMap names = IntMap.fromDistinctAscList (zip [0 ..] (listValue names))@@ -114,7 +115,7 @@   let rawPairs = zip objectIds classIds   let     pairs = Maybe.mapMaybe-      ( \(objectId, maybeClassId) -> case maybeClassId of+      (\(objectId, maybeClassId) -> case maybeClassId of         Nothing -> Nothing         Just classId -> Just (objectId, classId)       )@@ -133,9 +134,8 @@   -> List Cache   -> [(Maybe Str, Word32le, Word32le, Word32le)] makeClassCache classMap caches = fmap-  ( \cache ->-    let-      classId = cacheClassId cache+  (\cache ->+    let classId = cacheClassId cache     in       ( lookupL classId classMap       , classId@@ -147,8 +147,8 @@  makeClassMap :: List ClassMapping -> Bimap Word32le Str makeClassMap classMappings = bimap-  ( fmap-    ( \classMapping ->+  (fmap+    (\classMapping ->       (classMappingStreamId classMapping, classMappingName classMapping)     )     (listValue classMappings)@@ -156,12 +156,12 @@  makeAttributeMap :: List Cache -> Map Word32le (Map Word32le Word32le) makeAttributeMap caches = Map.fromList-  ( fmap-    ( \cache ->+  (fmap+    (\cache ->       ( cacheClassId cache       , Map.fromList-        ( fmap-          ( \attributeMapping ->+        (fmap+          (\attributeMapping ->             ( attributeMappingStreamId attributeMapping             , attributeMappingObjectId attributeMapping             )@@ -176,10 +176,10 @@ makeShallowParentMap   :: [(Maybe Str, Word32le, Word32le, Word32le)] -> Map Word32le Word32le makeShallowParentMap classCache = Map.fromList-  ( Maybe.mapMaybe-    ( \xs -> case xs of+  (Maybe.mapMaybe+    (\xs -> case xs of       [] -> Nothing-      (maybeClassName, classId, _, parentCacheId):rest -> do+      (maybeClassName, classId, _, parentCacheId) : rest -> do         parentClassId <- getParentClass maybeClassName parentCacheId rest         pure (classId, parentClassId)     )@@ -189,8 +189,7 @@ makeParentMap   :: [(Maybe Str, Word32le, Word32le, Word32le)] -> Map Word32le [Word32le] makeParentMap classCache =-  let-    shallowParentMap = makeShallowParentMap classCache+  let shallowParentMap = makeShallowParentMap classCache   in     Map.mapWithKey       (\classId _ -> getParentClasses shallowParentMap classId)@@ -219,7 +218,7 @@     [] -> if parentCacheId == Word32le 0       then Nothing       else getParentClassById (Word32le (word32leValue parentCacheId - 1)) xs-    (_, parentClassId, _, _):_ -> Just parentClassId+    (_, parentClassId, _, _) : _ -> Just parentClassId  getParentClassByName   :: Str@@ -232,13 +231,13 @@     Just parentClassName -> Maybe.maybe       (getParentClassById parentCacheId xs)       Just-      ( Maybe.listToMaybe-        ( fmap+      (Maybe.listToMaybe+        (fmap           (\(_, parentClassId, _, _) -> parentClassId)-          ( filter+          (filter             (\(_, _, cacheId, _) -> cacheId <= parentCacheId)-            ( filter-              ( \(maybeClassName, _, _, _) ->+            (filter+              (\(maybeClassName, _, _, _) ->                 maybeClassName == Just parentClassName               )               xs@@ -271,18 +270,17 @@     boostPickup = Text.pack "TheWorld:PersistentLevel.VehiclePickup_Boost_TA"     mapScoreboard = Text.pack "TheWorld:PersistentLevel.InMapScoreboard_TA"     breakout = Text.pack "TheWorld:PersistentLevel.BreakOutActor_Platform_TA"-  in-    if Text.isInfixOf crowdActor name-      then Str crowdActor-      else if Text.isInfixOf crowdManager name-        then Str crowdManager-        else if Text.isInfixOf boostPickup name-          then Str boostPickup-          else if Text.isInfixOf mapScoreboard name-            then Str mapScoreboard-            else if Text.isInfixOf breakout name-              then Str breakout-              else objectName+  in if Text.isInfixOf crowdActor name+    then Str crowdActor+    else if Text.isInfixOf crowdManager name+      then Str crowdManager+      else if Text.isInfixOf boostPickup name+        then Str boostPickup+        else if Text.isInfixOf mapScoreboard name+          then Str mapScoreboard+          else if Text.isInfixOf breakout name+            then Str breakout+            else objectName  objectClasses :: Map Str Str objectClasses =
library/Rattletrap/Type/ClassMapping.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.ClassMapping   ( ClassMapping(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Str
library/Rattletrap/Type/ClubColorsAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.ClubColorsAttribute   ( ClubColorsAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word8le
library/Rattletrap/Type/Common.hs view
@@ -9,7 +9,8 @@   , Word.Word32   , Word.Word64   , deriveJson-  ) where+  )+where  import qualified Data.Aeson as Json import qualified Data.Aeson.TH as Json@@ -37,7 +38,7 @@ lowerFirst :: String -> String lowerFirst string = case string of   "" -> string-  first:rest -> Char.toLower first : rest+  first : rest -> Char.toLower first : rest  toSnakeCase :: String -> String toSnakeCase = Json.camelTo2 '_'@@ -50,6 +51,6 @@ dropPrefix :: Eq a => [a] -> [a] -> Maybe [a] dropPrefix prefix list = case prefix of   [] -> Just list-  ph:pt -> case list of+  ph : pt -> case list of     [] -> Nothing-    lh:lt -> if ph == lh then dropPrefix pt lt else Nothing+    lh : lt -> if ph == lh then dropPrefix pt lt else Nothing
library/Rattletrap/Type/CompressedWord.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.CompressedWord   ( CompressedWord(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/CompressedWordVector.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.CompressedWordVector   ( CompressedWordVector(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.CompressedWord
library/Rattletrap/Type/Content.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Content   ( Content(..)-  ) where+  )+where  import Rattletrap.Type.Cache import Rattletrap.Type.ClassMapping
library/Rattletrap/Type/DamageStateAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.DamageStateAttribute   ( DamageStateAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int32le
library/Rattletrap/Type/DemolishAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.DemolishAttribute   ( DemolishAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Vector
library/Rattletrap/Type/DestroyedReplication.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.DestroyedReplication   ( DestroyedReplication(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/Dictionary.hs view
@@ -1,7 +1,8 @@ module Rattletrap.Type.Dictionary   ( Dictionary(..)   , dictionaryLookup-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Str
library/Rattletrap/Type/EnumAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.EnumAttribute   ( EnumAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/ExplosionAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.ExplosionAttribute   ( ExplosionAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int32le
library/Rattletrap/Type/ExtendedExplosionAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.ExtendedExplosionAttribute   ( ExtendedExplosionAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.ExplosionAttribute
library/Rattletrap/Type/FlaggedIntAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.FlaggedIntAttribute   ( FlaggedIntAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int32le
library/Rattletrap/Type/Float32le.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Float32le   ( Float32le(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/FloatAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.FloatAttribute   ( FloatAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Float32le
library/Rattletrap/Type/Frame.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Frame   ( Frame(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Float32le
library/Rattletrap/Type/GameModeAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.GameModeAttribute   ( GameModeAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/Header.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Header   ( Header(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Dictionary
library/Rattletrap/Type/Initialization.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Initialization   ( Initialization(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int8Vector
library/Rattletrap/Type/Int32le.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Int32le   ( Int32le(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/Int64Attribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Int64Attribute   ( Int64Attribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int64le
library/Rattletrap/Type/Int64le.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Int64le   ( Int64le(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/Int8Vector.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Int8Vector   ( Int8Vector(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int8le
library/Rattletrap/Type/Int8le.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Int8le   ( Int8le(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/IntAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.IntAttribute   ( IntAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int32le
library/Rattletrap/Type/KeyFrame.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.KeyFrame   ( KeyFrame(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Float32le
library/Rattletrap/Type/List.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.List   ( List(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/LoadoutAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.LoadoutAttribute   ( LoadoutAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word32le
library/Rattletrap/Type/LoadoutOnlineAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.LoadoutOnlineAttribute   ( LoadoutOnlineAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.ProductAttribute
library/Rattletrap/Type/LoadoutsAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.LoadoutsAttribute   ( LoadoutsAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.LoadoutAttribute
library/Rattletrap/Type/LoadoutsOnlineAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.LoadoutsOnlineAttribute   ( LoadoutsOnlineAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.LoadoutOnlineAttribute
library/Rattletrap/Type/LocationAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.LocationAttribute   ( LocationAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Vector
library/Rattletrap/Type/Mark.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Mark   ( Mark(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Str
library/Rattletrap/Type/Message.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Message   ( Message(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Str
library/Rattletrap/Type/MusicStingerAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.MusicStingerAttribute   ( MusicStingerAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word32le
library/Rattletrap/Type/PartyLeaderAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.PartyLeaderAttribute   ( PartyLeaderAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.RemoteId
library/Rattletrap/Type/PickupAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.PickupAttribute   ( PickupAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word32le
library/Rattletrap/Type/PlayerHistoryKeyAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.PlayerHistoryKeyAttribute   ( PlayerHistoryKeyAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Bitstream import Rattletrap.Type.Common
library/Rattletrap/Type/PrivateMatchSettingsAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.PrivateMatchSettingsAttribute   ( PrivateMatchSettingsAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Str
library/Rattletrap/Type/ProductAttribute.hs view
@@ -3,7 +3,8 @@ module Rattletrap.Type.ProductAttribute   ( ProductAttribute(..)   , ProductAttributeValue(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.CompressedWord
library/Rattletrap/Type/Property.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Property   ( Property(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.PropertyValue
library/Rattletrap/Type/PropertyValue.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.PropertyValue   ( PropertyValue(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Dictionary
library/Rattletrap/Type/QWordAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.QWordAttribute   ( QWordAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word64le
library/Rattletrap/Type/RemoteId.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.RemoteId   ( RemoteId(..)-  ) where+  )+where  import Rattletrap.Type.Bitstream import Rattletrap.Type.Common
library/Rattletrap/Type/Replay.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Replay   ( Replay(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Content
library/Rattletrap/Type/Replication.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Replication   ( Replication(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.CompressedWord
library/Rattletrap/Type/ReplicationValue.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.ReplicationValue   ( ReplicationValue(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.DestroyedReplication
library/Rattletrap/Type/ReservationAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.ReservationAttribute   ( ReservationAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.CompressedWord
library/Rattletrap/Type/RigidBodyStateAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.RigidBodyStateAttribute   ( RigidBodyStateAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Rotation
library/Rattletrap/Type/Section.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Section   ( Section(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word32le
library/Rattletrap/Type/SpawnedReplication.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.SpawnedReplication   ( SpawnedReplication(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Initialization
library/Rattletrap/Type/StatEventAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.StatEventAttribute   ( StatEventAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Int32le
library/Rattletrap/Type/Str.hs view
@@ -4,7 +4,8 @@   ( Str(..)   , toStr   , fromStr-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/StringAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.StringAttribute   ( StringAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Str
library/Rattletrap/Type/TeamPaintAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.TeamPaintAttribute   ( TeamPaintAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word32le
library/Rattletrap/Type/TitleAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.TitleAttribute   ( TitleAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Word32le
library/Rattletrap/Type/UniqueIdAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.UniqueIdAttribute   ( UniqueIdAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.RemoteId
library/Rattletrap/Type/UpdatedReplication.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.UpdatedReplication   ( UpdatedReplication(..)-  ) where+  )+where  import Rattletrap.Type.Attribute import Rattletrap.Type.Common
library/Rattletrap/Type/Vector.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Vector   ( Vector(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.CompressedWord
library/Rattletrap/Type/WeldedInfoAttribute.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.WeldedInfoAttribute   ( WeldedInfoAttribute(..)-  ) where+  )+where  import Rattletrap.Type.Common import Rattletrap.Type.Float32le
library/Rattletrap/Type/Word32le.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Word32le   ( Word32le(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/Word64le.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Word64le   ( Word64le(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Type/Word8le.hs view
@@ -2,7 +2,8 @@  module Rattletrap.Type.Word8le   ( Word8le(..)-  ) where+  )+where  import Rattletrap.Type.Common 
library/Rattletrap/Utility/Bytes.hs view
@@ -3,22 +3,21 @@   , padBytes   , reverseByte   , reverseBytes-  ) where+  )+where  import qualified Data.Bits as Bits-import qualified Data.ByteString.Lazy as LazyBytes-import qualified Data.ByteString.Lazy.Char8 as LazyBytes8+import qualified Data.ByteString as Bytes+import qualified Data.ByteString.Char8 as Bytes8 import qualified Data.Text as Text import qualified Data.Word as Word -encodeLatin1 :: Text.Text -> LazyBytes.ByteString-encodeLatin1 text = LazyBytes8.pack (Text.unpack text)+encodeLatin1 :: Text.Text -> Bytes.ByteString+encodeLatin1 text = Bytes8.pack (Text.unpack text) -padBytes :: Integral a => a -> LazyBytes.ByteString -> LazyBytes.ByteString-padBytes size bytes = LazyBytes.concat-  [ bytes-  , LazyBytes.replicate (fromIntegral size - LazyBytes.length bytes) 0x00-  ]+padBytes :: Integral a => a -> Bytes.ByteString -> Bytes.ByteString+padBytes size bytes =+  bytes <> Bytes.replicate (fromIntegral size - Bytes.length bytes) 0x00  reverseByte :: Word.Word8 -> Word.Word8 reverseByte byte =@@ -31,5 +30,5 @@     + Bits.shiftL (byte Bits..&. Bits.bit 1) 5     + Bits.shiftL (byte Bits..&. Bits.bit 0) 7 -reverseBytes :: LazyBytes.ByteString -> LazyBytes.ByteString-reverseBytes = LazyBytes.map reverseByte+reverseBytes :: Bytes.ByteString -> Bytes.ByteString+reverseBytes = Bytes.map reverseByte
library/Rattletrap/Utility/Crc.hs view
@@ -1,11 +1,12 @@ module Rattletrap.Utility.Crc   ( getCrc32-  ) where+  )+where  import Rattletrap.Data  import qualified Data.Bits as Bits-import qualified Data.ByteString.Lazy as LazyBytes+import qualified Data.ByteString as Bytes import qualified Data.IntMap as IntMap import qualified Data.Word as Word @@ -18,12 +19,12 @@ -- -- This CRC uses an initial value of @0xefcbf201@ and a polynomial of -- @0x04c11db7@.-getCrc32 :: LazyBytes.ByteString -> Word.Word32+getCrc32 :: Bytes.ByteString -> Word.Word32 getCrc32 bytes = do   let     update = crc32Update crc32Table     initial = Bits.complement crc32Initial-    crc = LazyBytes.foldl update initial bytes+    crc = Bytes.foldl update initial bytes   Bits.complement crc  crc32Update
library/Rattletrap/Utility/Helper.hs view
@@ -5,7 +5,8 @@   , encodeReplayJson   , decodeReplayJson   , encodeReplayFile-  ) where+  )+where  import Rattletrap.Decode.Common import Rattletrap.Decode.Replay@@ -15,24 +16,26 @@ import qualified Data.Aeson as Json import qualified Data.Aeson.Encode.Pretty as Json import qualified Data.Binary.Put as Binary+import qualified Data.ByteString as Bytes import qualified Data.ByteString.Lazy as LazyBytes  -- | Parses a raw replay.-decodeReplayFile :: LazyBytes.ByteString -> Either String Replay+decodeReplayFile :: Bytes.ByteString -> Either String Replay decodeReplayFile = runDecode decodeReplay  -- | Encodes a replay as JSON.-encodeReplayJson :: Replay -> LazyBytes.ByteString-encodeReplayJson = Json.encodePretty' Json.defConfig+encodeReplayJson :: Replay -> Bytes.ByteString+encodeReplayJson = LazyBytes.toStrict . Json.encodePretty' Json.defConfig   { Json.confCompare = compare   , Json.confIndent = Json.Spaces 2   , Json.confTrailingNewline = True   }  -- | Parses a JSON replay.-decodeReplayJson :: LazyBytes.ByteString -> Either String Replay-decodeReplayJson = Json.eitherDecode+decodeReplayJson :: Bytes.ByteString -> Either String Replay+decodeReplayJson = Json.eitherDecodeStrict'  -- | Encodes a raw replay.-encodeReplayFile :: Replay -> LazyBytes.ByteString-encodeReplayFile replay = Binary.runPut (putReplay replay)+encodeReplayFile :: Replay -> Bytes.ByteString+encodeReplayFile replay =+  LazyBytes.toStrict (Binary.runPut (putReplay replay))
package.yaml view
@@ -1,5 +1,5 @@ name: rattletrap-version: 6.0.1+version: 6.0.2  category: Game description: Rattletrap parses and generates Rocket League replays.@@ -17,15 +17,15 @@ dependencies:   aeson-pretty: '>= 0.8.5 && < 0.9'   aeson: '>= 1.2.4 && < 1.5'-  base: '>= 4.11.1 && < 4.12'+  base: '>= 4.11.1 && < 4.13'   binary-bits: '>= 0.5 && < 0.6'   binary: '>= 0.8.5 && < 0.9'   bytestring: '>= 0.10.8 && < 0.11'-  containers: '>= 0.5.10 && < 0.6'+  containers: '>= 0.5.10 && < 0.7'   filepath: '>= 1.4.1 && < 1.5'   http-client-tls: '>= 0.3.5 && < 0.4'   http-client: '>= 0.5.10 && < 0.6'-  template-haskell: '>= 2.13.0 && < 2.14'+  template-haskell: '>= 2.13.0 && < 2.15'   text: '>= 1.2.3 && < 1.3'   transformers: '>= 0.5.2 && < 0.6' ghc-options:@@ -60,6 +60,7 @@ tests:   test:     dependencies:+      clock: '>= 0.7.2 && < 0.8'       HUnit: '>= 1.6.0 && < 1.7'       rattletrap: -any       temporary: '>= 1.2.1 && < 1.4'
rattletrap.cabal view
@@ -1,11 +1,13 @@--- This file has been generated from package.yaml by hpack version 0.28.2.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.0. -- -- see: https://github.com/sol/hpack ----- hash: 5f18412041770e9f418d1274e2af2d5ca7264e94a41ca10e62566ccf3a1130f7+-- hash: 6bd15767c71dbb8fd1cbe890879aae6017938021cc9bbb82fc3d7ec5509e87fb  name:           rattletrap-version:        6.0.1+version:        6.0.2 synopsis:       Parse and generate Rocket League replays. description:    Rattletrap parses and generates Rocket League replays. category:       Game@@ -15,7 +17,6 @@ license:        MIT license-file:   LICENSE.markdown build-type:     Simple-cabal-version:  >= 1.10 extra-source-files:     CHANGELOG.markdown     package.yaml@@ -272,15 +273,15 @@   build-depends:       aeson >=1.2.4 && <1.5     , aeson-pretty >=0.8.5 && <0.9-    , base >=4.11.1 && <4.12+    , base >=4.11.1 && <4.13     , binary >=0.8.5 && <0.9     , binary-bits >=0.5 && <0.6     , bytestring >=0.10.8 && <0.11-    , containers >=0.5.10 && <0.6+    , containers >=0.5.10 && <0.7     , filepath >=1.4.1 && <1.5     , http-client >=0.5.10 && <0.6     , http-client-tls >=0.3.5 && <0.4-    , template-haskell >=2.13.0 && <2.14+    , template-haskell >=2.13.0 && <2.15     , text >=1.2.3 && <1.3     , transformers >=0.5.2 && <0.6   default-language: Haskell2010@@ -295,16 +296,16 @@   build-depends:       aeson >=1.2.4 && <1.5     , aeson-pretty >=0.8.5 && <0.9-    , base >=4.11.1 && <4.12+    , base >=4.11.1 && <4.13     , binary >=0.8.5 && <0.9     , binary-bits >=0.5 && <0.6     , bytestring >=0.10.8 && <0.11-    , containers >=0.5.10 && <0.6+    , containers >=0.5.10 && <0.7     , filepath >=1.4.1 && <1.5     , http-client >=0.5.10 && <0.6     , http-client-tls >=0.3.5 && <0.4     , rattletrap-    , template-haskell >=2.13.0 && <2.14+    , template-haskell >=2.13.0 && <2.15     , text >=1.2.3 && <1.3     , transformers >=0.5.2 && <0.6   if flag(static)@@ -323,16 +324,17 @@       HUnit >=1.6.0 && <1.7     , aeson >=1.2.4 && <1.5     , aeson-pretty >=0.8.5 && <0.9-    , base >=4.11.1 && <4.12+    , base >=4.11.1 && <4.13     , binary >=0.8.5 && <0.9     , binary-bits >=0.5 && <0.6     , bytestring >=0.10.8 && <0.11-    , containers >=0.5.10 && <0.6+    , clock >=0.7.2 && <0.8+    , containers >=0.5.10 && <0.7     , filepath >=1.4.1 && <1.5     , http-client >=0.5.10 && <0.6     , http-client-tls >=0.3.5 && <0.4     , rattletrap-    , template-haskell >=2.13.0 && <2.14+    , template-haskell >=2.13.0 && <2.15     , temporary >=1.2.1 && <1.4     , text >=1.2.3 && <1.3     , transformers >=0.5.2 && <0.6
stack.yaml view
@@ -1,1 +1,1 @@-resolver: lts-12.0+resolver: nightly-2018-11-01
tests/Main.hs view
@@ -5,11 +5,15 @@  import qualified Control.Monad as Monad import qualified Data.ByteString.Lazy as Bytes+import qualified Data.Int as Int import qualified Rattletrap.Console.Main as Rattletrap+import qualified System.Clock as Clock import qualified System.Exit as Exit import qualified System.FilePath as Path import qualified System.IO.Temp as Temp+import qualified System.Mem as Mem import qualified Test.HUnit as Test+import qualified Text.Printf as Printf  main :: IO () main = Temp.withSystemTempDirectory "rattletrap-" (runTests . toTests)@@ -39,14 +43,54 @@     jsonFile = Path.joinPath [directory, Path.addExtension uuid ".json"]     outputFile = Path.joinPath [directory, Path.addExtension uuid ".replay"]   input <- Bytes.readFile inputFile-  Rattletrap.rattletrap-    ""-    ["--compact", "--input", inputFile, "--output", jsonFile]-  Rattletrap.rattletrap "" ["--input", jsonFile, "--output", outputFile]+  putStrLn ("\t" <> uuid)+  do+    (((), allocated), elapsed) <- withElapsed+      (withAllocations (decode inputFile jsonFile))+    put "decoding" (Bytes.length input) (Clock.toNanoSecs elapsed) allocated+  do+    (((), allocated), elapsed) <- withElapsed+      (withAllocations (encode jsonFile outputFile))+    put "encoding" (Bytes.length input) (Clock.toNanoSecs elapsed) allocated   output <- Bytes.readFile outputFile   Monad.unless     (output == input)     (Test.assertFailure "output does not match input")++put :: String -> Int.Int64 -> Integer -> Int.Int64 -> IO ()+put label size elapsed allocated = Printf.printf+  "%s %d byte%s took %d nanosecond%s (%.3f MB/s) and allocated %d byte%s (%d x)\n"+  label+  size+  (if size == 1 then "" else "s")+  elapsed+  (if elapsed == 1 then "" else "s")+  ((1e9 * fromIntegral size) / (1048576 * fromIntegral elapsed) :: Double)+  allocated+  (if allocated == 1 then "" else "s")+  (div allocated size)++decode :: FilePath -> FilePath -> IO ()+decode input output =+  Rattletrap.rattletrap "" ["--compact", "--input", input, "--output", output]++encode :: FilePath -> FilePath -> IO ()+encode input output =+  Rattletrap.rattletrap "" ["--input", input, "--output", output]++withAllocations :: IO a -> IO (a, Int.Int64)+withAllocations action = do+  before <- Mem.getAllocationCounter+  result <- action+  after <- Mem.getAllocationCounter+  pure (result, before - after)++withElapsed :: IO a -> IO (a, Clock.TimeSpec)+withElapsed action = do+  before <- Clock.getTime Clock.Monotonic+  result <- action+  after <- Clock.getTime Clock.Monotonic+  pure (result, Clock.diffTimeSpec before after)  replays :: [(String, String)] replays =