File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ = begin pod
2
+
3
+ = TITLE role Metamodel::CurriedRoleHOW
4
+
5
+ = SUBTITLE Support for parametrized roles that have not been instantiated
6
+
7
+ class Metamodel::CurriedRoleHOW
8
+ does Metamodel::Naming
9
+ does Metamodel::TypePretense
10
+ does Metamodel::RolePunning {}
11
+
12
+ Sometimes, we see references to roles that provide parameters but
13
+ do not fully resolve them. For example, in:
14
+
15
+ = for code :preamble<role R[::Type] {}; class Type {}>
16
+ class C does R[Type] { }
17
+
18
+ We need to represent C < R[T] > , but we cannot yet fully specialize the
19
+ role because we don't have the first parameter at hand. We may also
20
+ run into the issue where we have things like:
21
+
22
+ = for code :preamble<role R[::T] {}; class T {}; my $x>
23
+ sub foo(R[T] $x) { ... }
24
+ if $x ~~ R[T] { ... }
25
+
26
+ Where we clearly want to talk about a partial parameterization of a
27
+ role and actually want to do so in a way distinct from a particular
28
+ instantiation of it. This meta-object represents those "partial types"
29
+ as both a way to curry on your way to a full specialization, but also
30
+ as a way to do type-checking or punning.
31
+
32
+ I < Note > : As most of the Metamodel classes, this class is here mainly for
33
+ illustration purposes and it's not intended for the final user.
34
+
35
+ = end pod
You can’t perform that action at this time.
0 commit comments