I noticed this strange behaviour:
val foo = for {
p1 <- managed(UIPeer(ID("1")))
} yield "foo"
foo.either.right.get
That returns "foo", as expected.
val foo = for {
p1 <- managed(UIPeer(ID("1")))
p2 <- managed(UIPeer(ID("2")))
} yield "foo"
foo.either.right.get
[error] value either is not a member of resource.ManagedResource[String]
[error] foo.either.right.get
[error] ^
Compare:
val foo = for {
b1 <- Some("foo")
b2 <- Some("baz")
} yield "bar"
foo.get
works just fine.
Maybe the map and/or flatMap implementation is broken (i.e. not following the monad laws)?
I noticed this strange behaviour:
That returns
"foo", as expected.Compare:
works just fine.
Maybe the
mapand/orflatMapimplementation is broken (i.e. not following the monad laws)?