[Haskell-beginners] Best way to trig an IO action on a condition.