genprimopcode: Applicative instance for ParserM

Signed-off-by: Austin Seipp <austin@well-typed.com>