Hello there here is my issue. This is my running code, which is fine:
showBalls = do howMany <- getInt return . take HowMany $ repeat 9 where my getInt does several checks in order to retrieve user input Int. However, my question is, is there a way to rewrite this part of code with the use of monads?
My aim is to use >>= and have a final one-line functions such as:
showBalls = fmap (take <$> (repeat 9)) getLine however it doesnt work (as expected). Any suggestion?