From 118abb64441c46aeb93e185000901c15d17bc60a Mon Sep 17 00:00:00 2001 From: Francis Russell Date: Sat, 15 Sep 2012 22:29:01 +0100 Subject: [PATCH] Remove a few unnecessary 'do' instances. --- src/Main.hs | 2 +- src/Parsing.hs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 054a36e..255d36a 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -14,7 +14,7 @@ getFileName _ = error "Usage: ofc input_file" processOFL :: String -> IO() processOFL input = - let result = parseAsOFL input in do + let result = parseAsOFL input in case result of Left err -> putStrLn $ show err Right ofl -> putStrLn $ show ofl diff --git a/src/Parsing.hs b/src/Parsing.hs index 507f630..e580128 100644 --- a/src/Parsing.hs +++ b/src/Parsing.hs @@ -144,8 +144,8 @@ parseFortranParam = do properties <- lCommaSep parseFortranParamProperty return $ FortranParameter properties -parseFortranParamProperty = do - (parseNameProperty <|> parseTypeProperty <|> parseSpaceProperty <|> parseIndexedProperty) where +parseFortranParamProperty = + parseNameProperty <|> parseTypeProperty <|> parseSpaceProperty <|> parseIndexedProperty where parseNameProperty = do _ <- lSymbol "name"; name <- lParens lStringLiteral; return $ ParamName name parseTypeProperty = do _ <- lSymbol "type"; fType <- lParens parseFortranType; return $ ParamType fType parseSpaceProperty = do _ <- lSymbol "space"; info <- lParens parseSpaceInfo; return $ Space info @@ -179,7 +179,7 @@ parsePPDFunctionSet = do properties <- lCommaSep parsePPDFunctionSetProperty return $ PPDFunctionSet properties -parsePPDFunctionSetProperty = do +parsePPDFunctionSetProperty = parseBasisProperty <|> parseDataProperty where parseBasisProperty = do _ <- lSymbol "basis"; ident <- lParens lIdentifier; return $ PPDBasis ident parseDataProperty = do _ <- lSymbol "data"; ident <- lParens lIdentifier; return $ PPDData ident -- 2.47.3