From: PHO Date: Thu, 25 Aug 2011 16:28:45 +0000 (+0900) Subject: Remove unnecessary 'try' X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=4498b6a;p=Lucu.git Remove unnecessary 'try' Ditz-issue: 8959dadc07db1bd363283dee401073f6e48dc7fa --- 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