From 4498b6a9091bebb38a92a730b7abff40833e3ed2 Mon Sep 17 00:00:00 2001 From: PHO Date: Fri, 26 Aug 2011 01:28:45 +0900 Subject: [PATCH] Remove unnecessary 'try' Ditz-issue: 8959dadc07db1bd363283dee401073f6e48dc7fa --- Network/HTTP/Lucu/Headers.hs | 2 +- Network/HTTP/Lucu/MIMEType.hs | 3 +-- Network/HTTP/Lucu/MultipartForm.hs | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Network/HTTP/Lucu/Headers.hs b/Network/HTTP/Lucu/Headers.hs index 400e49b..f87ae5c 100644 --- a/Network/HTTP/Lucu/Headers.hs +++ b/Network/HTTP/Lucu/Headers.hs @@ -101,7 +101,7 @@ fromHeaders (Headers m) = M.toList m -} headersP ∷ Parser Headers {-# INLINEABLE headersP #-} -headersP = do xs ← P.many $ try header +headersP = do xs ← P.many header crlf return $ toHeaders xs where diff --git a/Network/HTTP/Lucu/MIMEType.hs b/Network/HTTP/Lucu/MIMEType.hs index 318526d..9f2cb87 100644 --- a/Network/HTTP/Lucu/MIMEType.hs +++ b/Network/HTTP/Lucu/MIMEType.hs @@ -72,8 +72,7 @@ parseMIMEType str Left err → error ("unparsable MIME Type: " ⧺ C8.unpack bs ⧺ ": " ⧺ err) mimeTypeP ∷ Parser MIMEType -mimeTypeP = try $ - do maj ← A.toCIAscii <$> token +mimeTypeP = do maj ← A.toCIAscii <$> token _ ← char '/' min ← A.toCIAscii <$> token params ← P.many paramP diff --git a/Network/HTTP/Lucu/MultipartForm.hs b/Network/HTTP/Lucu/MultipartForm.hs index db32a4c..7ddcbd0 100644 --- a/Network/HTTP/Lucu/MultipartForm.hs +++ b/Network/HTTP/Lucu/MultipartForm.hs @@ -140,8 +140,7 @@ getContDispo hdr ]) contDispoP ∷ Parser ContDispo -contDispoP = try $ - do dispoType ← A.toCIAscii <$> token +contDispoP = do dispoType ← A.toCIAscii <$> token params ← many paramP return $ ContDispo dispoType params where -- 2.40.0