sviperll / adt4j

adt4j - Algebraic Data Types for Java
BSD 3-Clause "New" or "Revised" License
143 stars 8 forks source link

Implement polymorphic updates #33

Open sviperll opened 8 years ago

sviperll commented 8 years ago

This should work...

    Optional<Integer> i = flag ? Optional.present(5) : Optional.missing();
    Optional<String> m = i.withValue("5"); // Generated updater method