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.
Source: stackoverflow.com
Related Query
- Find type class instance for Shapeless HList in Scalaz state monad
- Find type class instances for Shapeless HList
- Define scalaz monad instance for a shapeless hlist
- type class NumberLike instance for Coproduct with shapeless
- cannot find class manifest for element type T
- Round-up of Scalaz type class instances for other libraries
- Doobie cannot find or construct a Read instance for type T
- About Scala generics: cannot find class manifest for element type T
- Scalaz - combining List and State Monad in for comprehension
- Cannot find JsonWriter or JsonFormat type class for a case class
- Creating a type class instance for a sealed trait
- Shapeless find instance of Some among Nones in an Hlist of Options
- Generic derivation of type class instance for ADT
- Type class for uniting unrelated failure cases in my Scalaz disjunctions
- Scala: Using right type class instance for reflected/runtime instance
- Scala: implicit lookup of type class instance for path-dependent type
- Shapeless type inference for HList does not work
- Scala type parameterization, Shapeless - could not find implicit value for parameter Generic
- Scala-Play Form: Cannot find Formatter type class for Enumeration subtype
- Scala doesn't derive dependent type for shapeless HList (using Aux)
- Cannot find JsonReader or JsonFormat type class for List[...]
- How to create Dataset with case class Type Parameter ? (Unable to find encoder for type T)
- How to extract label from Shapeless record for generic type class derivation
- Shapeless HList foldLeft with type class requirement in operation
- Cannot derive implicit instance of type class using shapeless
- How to apply a list of modifciations on a scalaz State Monad without for comprehension
- spray-json Cannot find JsonWriter or JsonFormat type class for Class
- Spray Json: Cannot find JsonWriter or JsonFormat type class for
- creating implicit type class instance in generic way for Seq collections
- Scalaz iteratees: "Lifting" `EnumeratorT` to match `IterateeT` for a "bigger" monad
More Query from same tag
- Akka UDP: "Invalid Argument" when sending to any destination which is not 127.0.0.1
- How print all actors in akka system?
- Can I use a scala class which implements a java interface from Java?
- Scala multiple assignment to existing variable
- How to unhide the unchecked warning when ClassTag is synthesised for a type with erased parameters?
- How to new a class inside an object?
- Read JSON Tree structure in Scala Play Framework
- Scala outputs on the command-line, but not in Eclipse Scala IDE
- How to get all distinct elements per key in DataFrame?
- Play ReactiveMongo: Need to create generic result class for RawCommand using ReactiveMongo
- Project a new Date into aggregation pipeline using reactivemongo
- How can I dynamically invoke the same scala function in cascading manner with output of previous call goes as input to the next call
- Hard time understanding the basics of Scala
- Share HDInsight SPARK SQL Table saveAsTable does not work
- Spark read from Teradata view which has column with Title
- Running scalastyle in a SBT multi project build
- Best way to create a list from another list's members in Scala
- How to specify number of checks to the forAll method in property checks
- Define 'copy' method in trait for case class
- How to Find the maximum consecutive years for each ID using Scala / Spark
- Why the expr parser only can parse the first item of it?
- How to dynamical bind a method reference to a trait?
- Correct usage of js.ThisFunction0
- Slick Future Returning Empty
- Alternatives to point to GitLab private registry for Scala (Play) projects?
- Clearing a lazy value from memory
- Gatling Configuration
- Java Reflection in Scala
- Howto render a form with list mapping
- matching more than one element from a sequence of elements