News for hackers. Stuff that matters.
Re:Concepts: The Future of Generic Programming [pdf] by vmarsy on Tuesday December 20, 2016 @07:11PM (#13225610)
What you're describing is more in the domain of program verification,

there's already work like this, for instance dafny [1], where you can have functions like this:

    method Abs(x: int) returns (y: int)
       ensures 0 <= y
    {
       ...
    }
or:

    method MultipleReturns(x: int, y: int) returns (more: int, less: int)
       requires 0 < y
       ensures less < x < more
    {
       more := x + y;
       less := x - y;
    }
[1] https://www.microsoft.com/en-us/research/project/dafny-a-lan...

There are no comments on this comment yet.