made checkType a writer monad and constraint a monoid