News for hackers. Stuff that matters.
Re:Kind: A Modern Proof Language by dash2 on Wednesday August 11, 2021 @08:01PM (#28149840)
I think Perl 6 aka Raku allows this, you can say something like `Person but $age < 18`.
Re:Kind: A Modern Proof Language by b2gills on Tuesday August 24, 2021 @04:15PM (#28294371)
The `but` keyword takes an instance and something to mix into it.

So you can say something like this:

    0 but True
---

Since `True` is a `Bool` it automatically creates a role that has a method `Bool` that returns `True`.

    my $role = role { method Bool { True }}
You can do that manually if you want.

    0 but role { method Bool { True }}
---

It creates a new subclass of Int and mixes in the role.

So:

    0 but True
Is roughly equivalent to:

    do {
      my constant but-true = anon role { method Bool { True }}
      my $class = anon class :: is Int does but-true {}

      $class.new( 0 )
    }
Re:Kind: A Modern Proof Language by lizmat on Friday August 13, 2021 @05:17AM (#28166964)
I think the you mean: `subset Minor of Person where *.age < 18`