I think Scala will convert IO [IO [Unit]] to IO [Unit] in the second case. Try to run both options in the Scala console and not specify the type for def converterFlatMap: IO[Unit], and you will see the difference.
, , IO:
IO [IO [T]], run IO, IO [IO [T]], PrintLine ReadLine.
flatMap IO, IO[T], T A IO, .
P.S.: , . , , , :
PrintLine("enter a temperate in degrees F").flatMap { case _ =>
ReadLine.map(_.toDouble).flatMap { case d =>
PrintLine((d + 32).toString).map { case _ => ()}
}
}
, flatMaps/maps .
P.P.S: for flatMap, map. , Scala "return", ,
(, return (3) IO [Int], run 3.),
for (x <- a; y <- b) yield y
a.flatMap(x => b.flatMap( y => return(y))),
b.flatMap( y => return(y)) , b.map(y => y) Scala .