Skip to content

Why does Writer.tell return Writer[T, Unit] ? #4235

@atais

Description

@atais

Hello.

I find it not handy at all. Let's say all my logic is based on a Writer[List[MappingError], T]

and now I can (sometimes) nicely compose it with value:

val foo: Writer[List[MappingError], Foo] = Writer.value(fooValue)

but now with tell:

val foo: Writer[List[MappingError], Unit] = Writer.tell(List(someError))

how is the Unit ever useful? I would expect it to bind to generic T that composes with the rest of my writer. Or there is some way to transform it, that I dont know of :-)?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions