Creating combinator-based grid-matching library