Yuval Kogman wrote:
> We already have the Set class, how do we say what it contains?
> class Set {
> has $.type;
> method members returns $.type () { ... }
> }
> my Set of Int $s = Set.new; # is this how you call it?
You are describing "Higher Order" types, also called Generic Algebraic Data
Types (GADTs) in Haskell.
Please refer to the earlier discussions
Parts 1 and 2 of http://xrl.us/f9re
I also started a similar post on a related note that was "warnocked", though the post was more to demonstrate an apparent syntax
isomorphism between Haskell and Perl 6 than posing a particular question (probably why it was unanswered).
http://xrl.us/f9rg
I think there has probably been other discussions, including one where Autrijus specifically asked this question for the Set module,
but I can't find that one.
Sam.