简体   繁体   English

关于具有元组的Haskell函数的问题

[英]Question about a Haskell function with tuples

how can help me getting this 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 : 您在snd的应用程序周围缺少括号:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM