Skip to content

Add function to produce IO<Unit> from TryEffect0<? extends IOException> #397

@MarekDudek

Description

@MarekDudek

I found that I often need such thing.

Already implemented and tested:

public static IO<Unit> fromTryEffect(TryEffect0<? extends IOException> t) {
    final Validation<? extends IOException, Unit> v = TryEffect.f(t).f();
    return v.isSuccess() ? ioUnit : () -> { throw v.fail(); };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions