WIP: add support of typed rules