Skip to content

Commit

Permalink
Remove unnecessary parens in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Jan 22, 2025
1 parent 8d41292 commit 2460489
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/Text/TeXMath/Readers/OMML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,16 @@ elemToExps' element | isElem "m" "f" element = do
let barType = filterChildName (hasElemName "m" "fPr") element >>=
filterChildName (hasElemName "m" "type") >>=
findAttrBy (hasElemName "m" "val")
let numExp = EGrouped $ concat $ mapMaybe (elemToExps) (elChildren num)
denExp = EGrouped $ concat $ mapMaybe (elemToExps) (elChildren den)
let numExp = EGrouped $ concat $ mapMaybe elemToExps (elChildren num)
denExp = EGrouped $ concat $ mapMaybe elemToExps (elChildren den)
case barType of
Just "noBar" -> Just [EFraction NoLineFrac numExp denExp]
_ -> Just [EFraction NormalFrac numExp denExp]
elemToExps' element | isElem "m" "func" element = do
fName <- filterChildName (hasElemName "m" "fName") element
baseExp <- filterChildName (hasElemName "m" "e") element >>=
elemToBase
let fnameExp = case mconcat $ mapMaybe (elemToExps') (elChildren fName) of
let fnameExp = case mconcat $ mapMaybe elemToExps' (elChildren fName) of
[x] -> x
xs -> EGrouped xs
return [fnameExp, baseExp]
Expand Down Expand Up @@ -350,14 +350,14 @@ elemToExps' element | isElem "m" "limLow" element = do
baseExp <- filterChildName (hasElemName "m" "e") element
>>= elemToBase
limExp <- filterChildName (hasElemName "m" "lim") element
>>= (\e -> Just $ concat $ mapMaybe (elemToExps) (elChildren e))
>>= (\e -> Just $ concat $ mapMaybe elemToExps (elChildren e))
>>= (return . EGrouped)
return [EUnder True baseExp limExp]
elemToExps' element | isElem "m" "limUpp" element = do
baseExp <- filterChildName (hasElemName "m" "e") element
>>= elemToBase
limExp <- filterChildName (hasElemName "m" "lim") element
>>= (\e -> Just $ concat $ mapMaybe (elemToExps) (elChildren e))
>>= (\e -> Just $ concat $ mapMaybe elemToExps (elChildren e))
>>= (return . EGrouped)
return [EOver True baseExp limExp]
elemToExps' element | isElem "m" "m" element =
Expand All @@ -381,9 +381,9 @@ elemToExps' element | isElem "m" "nary" element = do
filterChildName (hasElemName "m" "limLoc") >>=
findAttrBy (hasElemName "m" "val")
subExps <- filterChildName (hasElemName "m" "sub") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
supExps <- filterChildName (hasElemName "m" "sup") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
let baseExp = maybeToList $
filterChildName (hasElemName "m" "e") element >>= elemToBase
case limLoc of
Expand All @@ -404,17 +404,17 @@ elemToExps' element | isElem "m" "phant" element = do
return [EPhantom baseExp]
elemToExps' element | isElem "m" "rad" element = do
degExps <- filterChildName (hasElemName "m" "deg") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
baseExp <- filterChildName (hasElemName "m" "e") element >>=
elemToBase
return $ case degExps of
[] -> [ESqrt baseExp]
ds -> [ERoot (EGrouped ds) baseExp]
elemToExps' element | isElem "m" "sPre" element = do
subExps <- filterChildName (hasElemName "m" "sub") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
supExps <- filterChildName (hasElemName "m" "sup") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
baseExp <- filterChildName (hasElemName "m" "e") element >>=
elemToBase
return [ESubsup
Expand All @@ -426,21 +426,21 @@ elemToExps' element | isElem "m" "sSub" element = do
baseExp <- filterChildName (hasElemName "m" "e") element >>=
elemToBase
subExps <- filterChildName (hasElemName "m" "sub") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
return [ESub baseExp (EGrouped subExps)]
elemToExps' element | isElem "m" "sSubSup" element = do
baseExp <- filterChildName (hasElemName "m" "e") element >>=
elemToBase
subExps <- filterChildName (hasElemName "m" "sub") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
supExps <- filterChildName (hasElemName "m" "sup") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
return [ESubsup baseExp (EGrouped subExps) (EGrouped supExps)]
elemToExps' element | isElem "m" "sSup" element = do
baseExp <- filterChildName (hasElemName "m" "e") element >>=
elemToBase
supExps <- filterChildName (hasElemName "m" "sup") element >>=
(\e -> return $ concat $ mapMaybe (elemToExps) (elChildren e))
(\e -> return $ concat $ mapMaybe elemToExps (elChildren e))
return [ESuper baseExp (EGrouped supExps)]
elemToExps' element | isElem "m" "r" element = do
let mrPr = filterChildName (hasElemName "m" "rPr") element
Expand Down

0 comments on commit 2460489

Please sign in to comment.