@@ -565,8 +565,8 @@ thLiteral :: String -> TH.Q (TH.TExp ByteString)
565565#endif
566566thLiteral " " = [|| empty|| ]
567567thLiteral s = case foldr' op (Octets 0 [] ) s of
568- Octets ! n ws -> liftTyped (unsafePackLenBytes n ws)
569- Hichar ! i ! w -> liftCode $ fail $ " non-octet character '\\ " ++
568+ Octets n ws -> liftTyped (unsafePackLenBytes n ws)
569+ Hichar i w -> liftCode $ fail $ " non-octet character '\\ " ++
570570 show w ++ " ' at offset: " ++ show i
571571 where
572572 op _ (Hichar ! i ! w) = Hichar (i + 1 ) w
@@ -586,7 +586,7 @@ data H2W = Hex {-# UNPACK #-} !Int [Word8]
586586--
587587-- > :set -XTemplateHaskell
588588-- > ehloCmd :: ByteString
589- -- > ehloCmd = $$(thLiteral "45484c4F")
589+ -- > ehloCmd = $$(thHexLiteral "45484c4F")
590590--
591591#if MIN_VERSION_template_haskell(2,17,0)
592592thHexLiteral :: (MonadFail m , TH. Quote m ) => String -> TH. Code m ByteString
@@ -596,9 +596,9 @@ thHexLiteral :: String -> TH.Q (TH.TExp ByteString)
596596thHexLiteral " " = [|| empty|| ]
597597thHexLiteral s =
598598 case foldr' op (Hex 0 [] ) s of
599- ( Hex n ws) -> liftTyped (unsafePackLenBytes n ws)
600- ( Odd i _ _) -> liftCode $ fail $ " Odd input length: " ++ show (1 + 2 * i)
601- ( Bad i w) -> liftCode $ fail $ " Non-hexadecimal character '\\ " ++
599+ Hex n ws -> liftTyped (unsafePackLenBytes n ws)
600+ Odd i _ _ -> liftCode $ fail $ " Odd input length: " ++ show (1 + 2 * i)
601+ Bad i w -> liftCode $ fail $ " Non-hexadecimal character '\\ " ++
602602 show w ++ " ' at offset: " ++ show i
603603 where
604604 -- Convert char to decimal digit value if result in [0, 9].
0 commit comments