我的函数将 Maybe Int 列表作为其参数。如果元素 = Nothing 它应该打印一个 . 如果元素是 Just Int,它将打印数字。我以为我已经捕获了一个基本案例,但我认为我没有得到正确的。我得到一个非详尽的模式错误。
replaceValue :: [Maybe Int] -> String
replaceValue (x:xs)
| (x:xs) == [] = []
| isNothing x == True = '.':replaceValue xs
| isJust x == True = intToDigit(fromJust x):(replaceValue xs)
向正确方向点头将不胜感激!:-)