I have never worked with Haskell, but it seems quitte easy. Try when (isNothing date) $ exit (). If this also isn't working, then make sure your statement is correct. Also see this website for more info: Breaking From loop.