credit to Jim Duey re: ideas borrowed from protocol-monads