forked from GitHub/gf-core
From the documentation: the throwIO variant should be used in preference to throw to raise an exception within the IO monad because it guarantees ordering with respect to other IO operations, whereas throw does not. Also removed some unused imports.