问题类似于这个问题.但是,这个是关于异常,而不是懒惰的I/O.
这是一个测试:
{-# LANGUAGE ScopedTypeVariables #-}
import Prelude hiding ( catch )
import Control.Exception
fooLazy :: Int -> IO Int
fooLazy m = return $ 1 `div` m
fooStrict :: Int -> IO Int
fooStrict m = return $! 1 `div` m
test :: (Int -> IO Int) -> IO ()
test f = print =<< f 0 `catch` \(_ :: SomeException) -> return 42
testLazy :: Int -> IO Int
testLazy m = (return $ 1 `div` …Run Code Online (Sandbox Code Playgroud) 您可以在ASDF系统中设置的其他内容是:version属性.有没有办法在运行时读取它?有点像(system-version :my-system-name)?
我知道有asdf:version-satisfies和asdf:asdf-version,但也做我想做的在这种情况下.