我有这样的东西
isLastPermutation (h:t)=
catch (nextPermutation (h:t)) (\e-> return True)
return False在某些情况下,nextPermutation会抛出异常,如果nextPermutation抛出异常,我希望我的函数isLastPermutation返回true,否则返回false。
发布于 2013-03-22 01:13:20
不要在纯Haskell中使用流控制的异常。使用Maybe或Either。
https://stackoverflow.com/questions/15534577
复制相似问题