Hacker News new | ask | show | jobs
by lbhdc 646 days ago
This looks really interesting! It does look very rust like.

    auto get_x/(a, b)(const int^/a x, const int^/b y) -> const int^/a {
      return x;
    }
I like the new `choice` type. It looks like a c++ flavored rust enum.

    template<class T+, class E+>
    choice expected {
      [[safety::unwrap]] ok(T),
      err(E);
    
      T unwrap(self) noexcept safe {
        return match(self) -> T {
          .ok(t)  => rel t;
          .err(e) => panic("{} is err".format(expected~string));
        };
      }
    };