我将Maybes列表转换为字符串列表时遇到问题.
我的列表看起来像这样:[Nothing,Just 3,Just 9,Nothing,Nothing].
我想用点('.')取代所有Nothing,用'Int'取代所有Just Int.
到目前为止,我的解决方案无效.
[if c == Nothing then c = '.' else show (fromJust c) | c <- [Nothing, Just 3.... etc] ]
Run Code Online (Sandbox Code Playgroud)
我收到此错误消息:输入`='解析错误
我猜我不能给'c'的价值'.' 比如Java或其他语言.
有任何想法吗?
haskell ×1