this is my code:
askPointer = do
input <- getLine
let newInput = map toUpper input
[..here I will re-use new Input..]
return ()
Is it possible (maybe using lamba notation), to make this code shorter in one line only?
My attempt has been unsuccessfully:
input <- (\a b-> do toUpper (b <- getLine ) )
Any suggest?
Edit: little edit to make this question looking for more generic answers (not limiting to returning functions)
This should work:
If you
import Control.Applicativeyou can make it even shorter:Considering last edit:
or