Pattern matching and record syntax for type declaration