score:0

Accepted answer

If you use a lambda in your call to bind, then everything should be fine:

id.bind(s => template.format(s))

Alternatively, you could change your bind function to accept Seq[Any]:

def bind[A](f: ((Seq[Any]) => A)): A = {
  f(Seq(value))
}

Or:

def bind[A](f: (String*) => A): A = {
    f(value)
}

id.bind(template.format) // Works!!!

Related Query

More Query from same tag