AbstractPattern-matching programming is an example of a rule-based programming style developed in functional languages. This programming style is intensively used in dialects of ML but is restricted to algebraic data-types.This restriction limits the field of application. However, as shown by [9] at RULE'02, case-based function definitions can be extended to more general data structures called topological collections. We show in this paper that this extension retains the benefits of the typed discipline of the functional languages. More precisely, we show that topological collections and the rule-based definition of functions associated with them fit in a polytypic extension of mini-ML where type inference is still possible