开发者

Question about a Haskell function with tuples

开发者 https://www.devze.com 2023-02-27 09:54 出处:网络
how can help me getting thi开发者_运维问答s main function running, dont know how to do this, i made a small example:

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

精彩评论

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