develooper Front page | perl.perl5.porters | Postings from July 2020

Re: Types in Cor (and Perl)

Thread Previous | Thread Next
July 13, 2020 02:08
Re: Types in Cor (and Perl)
Message ID:
On Mon, 13 Jul 2020 at 03:52, Dave Rolsky <> wrote:

> On Sun, Jul 12, 2020 at 8:05 AM Ovid via perl5-porters <
>> wrote:
>> I know very little of Perl's internals or what this would mean. For Cor
>> V1, I'd be tempted to go with attributes and Types::Standard (
>> :isa(ArrayRef[Int])), but I strongly suspect that it will conflict with
>> David's work, and it won't provide the type safety one would expect.
> Rather than just borging Types::Standard directly I think it's worth
> thinking more about what a type system might look like. One huge issue I
> have with Types::Standard is that it just copies the mistakes of Moose, so
> let's not copy them into the core!
Great point, question IMHO is do we mean/need/want types or constraints?

- constraint is evaluated runtime
- type is declared and trusted

Child type can via inheritance break a constraint imposed by parent type.

Examples with primitive types look nice, but ... who uses primitives and
strong types ?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About