1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 13:51:44 +03:00

fmap with fewer parens.

This commit is contained in:
Rob Rix 2017-05-08 17:09:37 -04:00
parent 48457f13cc
commit ac832e9e4c

View File

@ -102,7 +102,7 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >>
Pure patch -> fmap summarize (sequenceA (runBothWith mapPatch (toInfo <$> sources) patch))
toInfo :: HasDefaultFields fields => Source -> Term (Syntax Text) (Record fields) -> [DiffInfo]
toInfo source = para $ \ (annotation :< syntax) -> let termName = toTermName source (cofree (annotation :< (fst <$> syntax))) in case syntax of
toInfo source = para $ \ (annotation :< syntax) -> let termName = toTermName source (cofree (annotation :< fmap fst syntax)) in case syntax of
S.ParseError _ -> [ErrorInfo (sourceSpan annotation) termName]
S.Indexed children -> children >>= snd
S.Fixed children -> children >>= snd