Created
March 12, 2022 22:38
-
-
Save gfldex/20c5dd0154820140a6acf16f14d78553 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @types = | |
Q{AST}, | |
Q{Allomorph}, | |
Q{Any}, | |
Q{Array}, | |
Q{Associative}, | |
Q{Attribute}, | |
Q{Awaitable}, | |
Q{Awaiter}, | |
Q{Backtrace}, | |
Q{Bag}, | |
Q{BagHash}, | |
Q{Baggy}, | |
Q{BigEndian}, | |
Q{Blob}, | |
Q{Block}, | |
Q{Bool}, | |
Q{Broken}, | |
Q{Buf}, | |
Q{CX}, | |
Q{CallFrame}, | |
Q{Callable}, | |
Q{Cancellation}, | |
Q{Capture}, | |
Q{Channel}, | |
Q{Code}, | |
Q{Collation}, | |
Q{CompUnit}, | |
Q{Compiler}, | |
Q{Complex}, | |
Q{ComplexStr}, | |
Q{ContainerDescriptor}, | |
Q{Cool}, | |
Q{CurrentThreadScheduler}, | |
Q{Cursor}, | |
Q{Date}, | |
Q{DateTime}, | |
Q{Dateish}, | |
Q{Deprecation}, | |
Q{Distribution}, | |
Q{Distro}, | |
Q{Duration}, | |
Q{EXPORTHOW}, | |
Q{Empty}, | |
Q{Encoding}, | |
Q{Endian}, | |
Q{Enumeration}, | |
Q{Exception}, | |
Q{Exceptions}, | |
Q{Failure}, | |
Q{False}, | |
Q{FatRat}, | |
Q{FileChangeEvent}, | |
Q{FileChanged}, | |
Q{FileRenamed}, | |
Q{ForeignCode}, | |
Q{Grammar}, | |
Q{HardRoutine}, | |
Q{Hash}, | |
Q{Hyper}, | |
Q{HyperConfiguration}, | |
Q{HyperSeq}, | |
Q{HyperWhatever}, | |
Q{IO}, | |
Q{Inf}, | |
Q{Instant}, | |
Q{Int}, | |
Q{IntAttrRef}, | |
Q{IntLexRef}, | |
Q{IntPosRef}, | |
Q{IntStr}, | |
Q{Iterable}, | |
Q{IterationBuffer}, | |
Q{Iterator}, | |
Q{JSONException}, | |
Q{Junction}, | |
Q{Kept}, | |
Q{Kernel}, | |
Q{Label}, | |
Q{Less}, | |
Q{List}, | |
Q{LittleEndian}, | |
Q{Lock}, | |
Q{Macro}, | |
Q{Map}, | |
Q{Match}, | |
Q{Metamodel}, | |
Q{Method}, | |
Q{MethodDispatcher}, | |
Q{Mix}, | |
Q{MixHash}, | |
Q{Mixy}, | |
Q{More}, | |
Q{Mu}, | |
Q{MultiDispatcher}, | |
Q{NFC}, | |
Q{NFD}, | |
Q{NFKC}, | |
Q{NFKD}, | |
Q{NQPMatchRole}, | |
Q{NQPdidMATCH}, | |
Q{NaN}, | |
Q{NativeEndian}, | |
Q{Nil}, | |
Q{Num}, | |
Q{NumAttrRef}, | |
Q{NumLexRef}, | |
Q{NumPosRef}, | |
Q{NumStr}, | |
Q{Numeric}, | |
Q{NumericEnumeration}, | |
Q{NumericStringyEnumeration}, | |
Q{ObjAt}, | |
Q{Order}, | |
Q{PF_INET}, | |
Q{PF_INET6}, | |
Q{PF_LOCAL}, | |
Q{PF_MAX}, | |
Q{PF_UNIX}, | |
Q{PF_UNSPEC}, | |
Q{PROCESS}, | |
Q{PROTO_TCP}, | |
Q{PROTO_UDP}, | |
Q{Pair}, | |
Q{ParallelSequence}, | |
Q{Parameter}, | |
Q{Perl}, | |
Q{PhasersList}, | |
Q{Planned}, | |
Q{Pod}, | |
Q{Positional}, | |
Q{PositionalBindFailover}, | |
Q{PredictiveIterator}, | |
Q{Proc}, | |
Q{Promise}, | |
Q{PromiseStatus}, | |
Q{ProtocolFamily}, | |
Q{ProtocolType}, | |
Q{Proxy}, | |
Q{PseudoStash}, | |
Q{QuantHash}, | |
Q{REPL}, | |
Q{RaceSeq}, | |
Q{Raku}, | |
Q{Rakudo}, | |
Q{Range}, | |
Q{Rat}, | |
Q{RatStr}, | |
Q{Rational}, | |
Q{Real}, | |
Q{Regex}, | |
Q{Routine}; | |
for @types.map({ ::($_) }) -> Mu $_ is raw { | |
next unless .HOW ~~ Metamodel::ClassHOW; | |
my $does-iterable = $_ ~~ Iterable ?? ‚does Iterable‘ !! ""; | |
my $sports-iterator = .^methods(:local)».name.any eq 'iterator' ?? ‚sports iterator‘ !! ""; | |
my $and = $does-iterable & $sports-iterator ?? ' and ' !! ''; | |
next unless $sports-iterator | $does-iterable; | |
say .^name, ' ', $does-iterable, $and, $sports-iterator; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment