In Haskell, you can throw an exception from purely functional code, but you can only catch in IO code.