【发布时间】:2016-01-05 22:21:10
【问题描述】:
我遇到了这个问题:
Couldn't match expected type ‘Int’ with actual type ‘Maybe Int’
我能以某种方式将“Maybe Int”转换为“Int”吗?
if index == Nothing
then
do
let index = 0
putStrLn(fancyPrint2 $ kaasasOlevList !! index)
else
do
let index = index
putStrLn(fancyPrint2 $ kaasasOlevList !! index)
我试过这样,但这给了我:
Exception: <<loop>>
【问题讨论】: