gcd: Euclid's algorithm with logging using the Writer Monad