這是我的代碼之前:操作變量(哈斯克爾)存儲
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