开发者

Question about a Haskell function with tuples

how can help me getting thi开发者_运维问答s main function running, dont know how to do this, i made a small example:

tuple :: String -> (Bool, String)
tuple x = (True, x)

getStr :: String
getStr = "test"

main = do
    putStrLn snd (tuple getStr)
    putStrLn "End"


You're missing parenthesis around the application of snd:

main = do
    putStrLn (snd (tuple getStr))
    putStrLn "End"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜