initial pattern matching implementation that uses parser combinators
checking before merging