From f314e3ca292c3a25241c8752ec9f067a95c1eb39 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sun, 29 Sep 2013 06:19:08 +0400 Subject: Code style --- src/Data/BEncode.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Data/BEncode.hs b/src/Data/BEncode.hs index 086d34f..6b26ee5 100644 --- a/src/Data/BEncode.hs +++ b/src/Data/BEncode.hs @@ -786,20 +786,20 @@ parser = valueP case c of -- if we have digit it always should be string length di | di <= '9' -> BString <$> stringP - 'i' -> P.anyChar *> ((BInteger <$> integerP) <* P.anyChar) - 'l' -> P.anyChar *> ((BList <$> listBody) <* P.anyChar) - 'd' -> P.anyChar *> (BDict <$> dictBodyP)<* P.anyChar + 'i' -> P.anyChar *> ((BInteger <$> integerP) <* P.anyChar) + 'l' -> P.anyChar *> ((BList <$> listBodyP) <* P.anyChar) + 'd' -> P.anyChar *> (BDict <$> dictBodyP) <* P.anyChar t -> fail ("bencode unknown tag: " ++ [t]) dictBodyP :: Parser BDict dictBodyP = Cons <$> stringP <*> valueP <*> dictBodyP <|> pure Nil - listBody = do + listBodyP = do c <- P.peekChar case c of Just 'e' -> return [] - _ -> (:) <$> valueP <*> listBody + _ -> (:) <$> valueP <*> listBodyP stringP :: Parser ByteString stringP = do -- cgit v1.2.3