首页 > 解决方案 > Has vavr io.vavr.API been removed in 1.0.0-alpha-2?

问题描述

I have been investigating the use of the excellent functional library vavr

  // https://mvnrepository.com/artifact/io.vavr/vavr
compile group: 'io.vavr', name: 'vavr', version: '0.9.2'
// https://mvnrepository.com/artifact/io.vavr/vavr-match
compile group: 'io.vavr', name: 'vavr-match', version: '0.9.2'

Using this type of example:-

int input = 2;
        String output = Match(input).of(Case($(1), "one"), Case($(2), "two"), Case($(3), "three"), Case($(), "?"));

        assertEquals("two", output);

using these static imports

import static io.vavr.API.$;
import static io.vavr.API.Case;
import static io.vavr.API.Match;

However when I upgrade to

// https://mvnrepository.com/artifact/io.vavr/vavr
compile group: 'io.vavr', name: 'vavr', version: '1.0.0-alpha-2'

I can no longer resolve the io.vavr.API imports.

Where have these been refactored to in the most recent version of vavr?

Have they been removed altogether?

标签: vavr

解决方案


io.vavr.API will still be part of Vavr 1.0, however, the contents most probably will be changed.

The alpha-* versions are increments. I will provide new features step-by-step in order to make them available for testing purposes.

I see that this is a bit confusing because my users expect more complete contents of an alpha version. Currently I'm working on that issue.

(Disclaimer: I'm the author of Vavr)


推荐阅读