Why does Writer.tell
return Writer[T, Unit]
?
#4236
-
Hello. I find it not handy at all. Let's say all my logic is based on a and now I can (sometimes) nicely compose it with
but now with
how is the |
Beta Was this translation helpful? Give feedback.
Answered by
armanbilge
Jun 14, 2022
Replies: 1 comment
-
Maybe you are looking for val foo: Writer[List[MappingError], Foo] = Writer.tell(List(someError)).as(fooValue) More generally you can compose using for {
foo <- Writer.value(fooValue)
_ <- Writer.tell(List(someError))
_ <- Writer.tell(List(anotherError))
bar <- Writer.value(barValue)
} yield foo |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
atais
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe you are looking for
as
? :)More generally you can compose using
flatMap
in a for-comprehension: