From: Francis Russell Date: Sat, 15 Sep 2012 21:29:01 +0000 (+0100) Subject: Remove a few unnecessary 'do' instances. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=118abb64441c46aeb93e185000901c15d17bc60a;p=francis%2Fofc.git Remove a few unnecessary 'do' instances. --- 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