[Haskell-beginners] point-free + IO Monad

Ovidiu D ovidiudeac at gmail.com
Sun Mar 31 08:55:24 CEST 2013


I have the following code:

f1 :: String -> String

f2 :: IO String -> IO ()
f2 a = do
   b <- a
   putStr $ f1 b

How can I write the function f2 in a point-free style?

I have tried this:
f2 = return.f1 >>=  putStr

...but it doesn't work.


Thanks!



More information about the Beginners mailing list