Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adds M::CurriedRoleHow
Mainly for the sake of illustration. Text copied from @jnthn comment
at the beginning of the source code. Refs #1306
  • Loading branch information
JJ committed Apr 13, 2019
1 parent ef7677f commit 8a35386
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions doc/Type/Metamodel/CurriedRoleHOW.pod6
@@ -0,0 +1,35 @@
=begin pod
=TITLE role Metamodel::CurriedRoleHOW
=SUBTITLE Support for parametrized roles that have not been instantiated
class Metamodel::CurriedRoleHOW
does Metamodel::Naming
does Metamodel::TypePretense
does Metamodel::RolePunning {}
Sometimes, we see references to roles that provide parameters but
do not fully resolve them. For example, in:
=for code :preamble<role R[::Type] {}; class Type {}>
class C does R[Type] { }
We need to represent C<R[T]>, but we cannot yet fully specialize the
role because we don't have the first parameter at hand. We may also
run into the issue where we have things like:
=for code :preamble<role R[::T] {}; class T {}; my $x>
sub foo(R[T] $x) { ... }
if $x ~~ R[T] { ... }
Where we clearly want to talk about a partial parameterization of a
role and actually want to do so in a way distinct from a particular
instantiation of it. This meta-object represents those "partial types"
as both a way to curry on your way to a full specialization, but also
as a way to do type-checking or punning.
I<Note>: As most of the Metamodel classes, this class is here mainly for
illustration purposes and it's not intended for the final user.
=end pod

0 comments on commit 8a35386

Please sign in to comment.