Hacker News new | ask | show | jobs
by _old_dude_ 1544 days ago
You need flow typing when you do pattern matching on generalized abstract data type (GADT). Here is an example in Java

    sealed interface Foo<T> permits Impl {}  // union type
    record Impl() implements Foo<String> {}  // product type

    <T> T m(Foo<T> foo) {
      return switch(foo) {
        case Impl impl -> "hello";  // flow typing T=String 
      };
    }
2 comments

By that definition, many (maybe most) languages then already support flow typing.
that's not the same as what is defined in the article, and it is supported by plenty of languages