score:0

The following compiles:

for {
  _ <- init[Int :: String :: HNil] flatMap { _  => take(_1) }
  x <- state("abc")
} yield x

The for-loop of your question is roughly translated to

init[Int :: String :: HNil] flatMap { _ =>
  take(_1) flatMap { _ =>
    state("abc") map { x =>
      x
    }
  }
}

and scalac seems not willing to infer the type argument of take(_1) given that it already has to infer some types below it and you call flatMap directly on it.


Related Query

More Query from same tag