Skip to content

Commit

Permalink
Remove duplicate function in concrete analysis (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
ii8 authored Sep 26, 2022
1 parent 13b038b commit 84aabe8
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1477,18 +1477,12 @@ makePatternTable ::
makePatternTable (PatternAtoms latoms _) = [appOp] : operators
where
getConstructorRef :: PatternAtom 'Scoped -> Maybe ConstructorRef
getConstructorRef s = case s of
PatternAtomIden iden -> case iden of
PatternScopedConstructor r -> Just r
PatternScopedVar {} -> Nothing
_ -> Nothing
operators = mkSymbolTable (mapMaybe constructorRefs (toList latoms))
constructorRefs :: PatternAtom 'Scoped -> Maybe ConstructorRef
constructorRefs = \case
getConstructorRef = \case
PatternAtomIden i -> case i of
PatternScopedConstructor c -> Just c
_ -> Nothing
_ -> Nothing
operators = mkSymbolTable (mapMaybe getConstructorRef (toList latoms))
mkSymbolTable :: [ConstructorRef] -> [[P.Operator ParsePat PatternArg]]
mkSymbolTable = reverse . map (map snd) . groupSortOn' fst . mapMaybe unqualifiedSymbolOp
where
Expand Down

0 comments on commit 84aabe8

Please sign in to comment.