質問があります: 例外をスローしてプログラムを終了するにはどうすればよいですか? 簡単な例を書き留めました:
-- main.hs
import Test
main = do
Test.foo ""
putStrLn "make some other things"
モジュールは次のとおりです。
moldule Test where
foo :: String -> IO ()
foo x = do
if null x
then THROW EXCEPTION AND EXIT MAIN else putStrLn "okay"
これを開始して例外をスローし、プログラムを終了したいのですが、どうすればよいですか?