I forgot to mention that patterns can be nested. This way we extract the definition list in one go, and the function `extractDefList` becomes easier to reason about.