groupoids and monads from them