From a856e1d8848dca68aac70fc192f92d2e317befe0 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Fri, 23 Jan 2026 00:31:04 +0800 Subject: [PATCH] Fix typos Found via `codespell -L noes` and `typos --hidden --format brief` --- changelog.md | 4 ++-- src/Data/Binary/Get.hs | 8 ++++---- src/Data/Binary/Get/Internal.hs | 6 +++--- tests/Action.hs | 6 +++--- tests/QC.hs | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/changelog.md b/changelog.md index 6ee81a39..13d4191e 100644 --- a/changelog.md +++ b/changelog.md @@ -121,7 +121,7 @@ binary-0.7.6.0 binary-0.7.5.0 -------------- -- Fix performance bug that was noticable when you get a big strict ByteString +- Fix performance bug that was noticeable when you get a big strict ByteString and the input to the decoder consists of many small chunks. - https://github.com/kolmodin/binary/issues/73 - https://github.com/kolmodin/binary/pull/76 @@ -196,7 +196,7 @@ binary-0.6.4 binary-0.6.3 ------------ -- Documentation tweeks, internal restructuring, more tests. +- Documentation tweaks, internal restructuring, more tests. binary-0.6.2 ------------ diff --git a/src/Data/Binary/Get.hs b/src/Data/Binary/Get.hs index 121955fa..a4ca63a2 100644 --- a/src/Data/Binary/Get.hs +++ b/src/Data/Binary/Get.hs @@ -257,7 +257,7 @@ import Data.Binary.FloatCast (wordToFloat, wordToDouble) -- If it succeeds it will return 'Done' with the resulting value, -- the position and the remaining input. --- | A decoder procuced by running a 'Get' monad. +-- | A decoder produced by running a 'Get' monad. data Decoder a = Fail !B.ByteString {-# UNPACK #-} !ByteOffset String -- ^ The decoder ran into an error. The decoder either used -- 'fail' or was not provided enough input. Contains any @@ -421,7 +421,7 @@ getRemainingLazyByteString :: Get L.ByteString getRemainingLazyByteString = withInputChunks () consumeAll L.fromChunks resumeOnEOF ------------------------------------------------------------------------ --- Primtives +-- Primitives -- helper, get a raw Ptr onto a strict ByteString copied out of the -- underlying lazy byteString. @@ -586,7 +586,7 @@ getWord32host :: Get Word32 getWord32host = getPtr (sizeOf (undefined :: Word32)) {-# INLINE getWord32host #-} --- | /O(1)./ Read a Word64 in native host order and host endianess. +-- | /O(1)./ Read a Word64 in native host order and host endianness. getWord64host :: Get Word64 getWord64host = getPtr (sizeOf (undefined :: Word64)) {-# INLINE getWord64host #-} @@ -607,7 +607,7 @@ getInt32host :: Get Int32 getInt32host = getPtr (sizeOf (undefined :: Int32)) {-# INLINE getInt32host #-} --- | /O(1)./ Read an Int64 in native host order and host endianess. +-- | /O(1)./ Read an Int64 in native host order and host endianness. getInt64host :: Get Int64 getInt64host = getPtr (sizeOf (undefined :: Int64)) {-# INLINE getInt64host #-} diff --git a/src/Data/Binary/Get/Internal.hs b/src/Data/Binary/Get/Internal.hs index 578cb732..28318b22 100644 --- a/src/Data/Binary/Get/Internal.hs +++ b/src/Data/Binary/Get/Internal.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP, RankNTypes, MagicHash, BangPatterns, TypeFamilies #-} --- CPP C style pre-precessing, the #if defined lines +-- CPP C style pre-processing, the #if defined lines -- RankNTypes forall r. statement -- MagicHash the (# unboxing #), also needs GHC.primitives @@ -56,7 +56,7 @@ import Data.Binary.Internal ( accursedUnutterablePerformIO ) -- Kolmodin 20100427: at zurihac we discussed of having partial take a -- "Maybe ByteString" and implemented it in this way. --- The reasoning was that you could accidently provide an empty bytestring, +-- The reasoning was that you could accidentally provide an empty bytestring, -- and it should not terminate the decoding (empty would mean eof). -- However, I'd say that it's also a risk that you get stuck in a loop, -- where you keep providing an empty string. Anyway, no new input should be @@ -76,7 +76,7 @@ data Decoder a = Fail !B.ByteString String -- output value you also get the unused input. | BytesRead {-# UNPACK #-} !Int64 (Int64 -> Decoder a) -- ^ The decoder needs to know the current position in the input. - -- Given the number of bytes remaning in the decoder, the outer + -- Given the number of bytes remaining in the decoder, the outer -- decoder runner needs to calculate the position and -- resume the decoding. diff --git a/tests/Action.hs b/tests/Action.hs index bf204670..ae5ccff8 100644 --- a/tests/Action.hs +++ b/tests/Action.hs @@ -171,7 +171,7 @@ prop_fail = " but got " ++ show off) | inp /= L.drop (fromIntegral off) lbs -> error $ "remaining output incorrect, was: " ++ show inp ++ - ", should hav been: " ++ show (L.drop (fromIntegral off) lbs) + ", should have been: " ++ show (L.drop (fromIntegral off) lbs) | otherwise -> property True Right (_inp, _off, _value) -> label "test case without 'fail'" $ property True @@ -197,7 +197,7 @@ failReason _ = "NoFail" -- | The result of an evaluation. data Eval = ESuccess Int - -- ^ The evalutation completed successfully. Contains the number of + -- ^ The evaluation completed successfully. Contains the number of -- remaining bytes of the input. | EFail FailReason [String] Int -- ^ The evaluation completed with a failure. Contains the labels up @@ -212,7 +212,7 @@ data FailReason deriving (Show,Eq) -- | Given the number of input bytes and a list of actions, evaluate the --- actions and return whether the actions succeeed or fail. +-- actions and return whether the actions succeed or fail. eval :: Int -> [Action] -> Eval eval inp0 = go inp0 [] where diff --git a/tests/QC.hs b/tests/QC.hs index 776768f4..aa6e7e26 100644 --- a/tests/QC.hs +++ b/tests/QC.hs @@ -265,7 +265,7 @@ prop_bytesRead lbs = -- | We're trying to guarantee that the Decoder will not ask for more input -- with Partial if it has been given Nothing once. -- In this test we're making the decoder return 'Partial' to get more --- input, and to get knownledge of the current position using 'BytesRead'. +-- input, and to get knowledge of the current position using 'BytesRead'. -- Both of these operations, when used with the <|> operator, result internally -- in that the decoder return with Partial and BytesRead multiple times, -- in which case we need to keep track of if the user has passed Nothing to a