formal languages and monads