News for hackers. Stuff that matters.
Re:Why don't more languages offer flow typing? by _old_dude_ on Monday April 04, 2022 @01:38PM (#30909579)
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 
      };
    }
Re:Why don't more languages offer flow typing? by valenterry on Monday April 04, 2022 @05:28PM (#30912149)
By that definition, many (maybe most) languages then already support flow typing.
Re:Why don't more languages offer flow typing? by whimsicalism on Monday April 04, 2022 @08:38PM (#30913849)
that's not the same as what is defined in the article, and it is supported by plenty of languages