这是我的代码之前:操作变量(哈斯克尔)存储
askPointer = do
input <- getLine
let newInput = map toUpper input
[..here I will re-use new Input..]
return()
是否有可能(可能使用兰巴表示法),以使此代码中只有一条线短?
我的尝试是不成功:
input <- (\a b-> do toUpper (b <- getLine))
任何建议?
编辑:小编辑,使这个问题寻找更通用的答案(不限制返回功能)
如何获得输入值? – nick
你能表达一点细节吗? – nick
@haskellguy:'输入<- getLine >> =返回。 map toUpper'或'input < - map toUpper <$> getLine' – beerboy