1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Avoid using wrap.

This commit is contained in:
Rob Rix 2019-06-03 12:17:39 -04:00
parent 40c467fc5d
commit 2430e16f79
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -200,7 +200,7 @@ choice :: (Enum grammar, Eq1 ast, Ix grammar, HasCallStack) => [Assignment ast g
choice [] = empty
choice alternatives
| null choices = asum alternatives
| otherwise = tracing (Choose (Table.fromListWith (<|>) choices) (wrap . tracing . Alt . toList <$> nonEmpty atEnd) (mergeHandlers handlers)) `Then` pure
| otherwise = tracing (Choose (Table.fromListWith (<|>) choices) ((`Then` id) . tracing . Alt . toList <$> nonEmpty atEnd) (mergeHandlers handlers)) `Then` pure
where (choices, atEnd, handlers) = foldMap toChoices alternatives
toChoices :: (Enum grammar, Ix grammar) => Assignment ast grammar a -> ([(grammar, Assignment ast grammar a)], [Assignment ast grammar a], [Error (Either String grammar) -> Assignment ast grammar a])
toChoices rule = case rule of