(feat) Cookie.

You are probably looking for and_then or something similar (aka the Maybe Monad)