oshun
oshun copied to clipboard
Declarative data validation for variables and subroutines
Why `my $dog :isa(Dog)` and `sub foo($dog :of(Dog)) { ... }` and not `my Dog $dog =...` and `my sub foo (Dog $dog)`? Perl has allowed `my Dog $dog =...
Tooling?
I love the idea of doing something like this but I wonder if we've fully identified the value, or agreed on WHY we are doing this. I do a lot...
https://developers.slashdot.org/story/23/08/07/0136228/should-a-variables-type-come-after-its-name
https://github.com/Perl-Oshun/oshun/blob/66eb75e20079881d9fb96ef774ef2e69858c911b/lib/Data/Checks.pm#L30 Consider: ```perl use strict; use warnings; use Data::Checks; { no Data::Checks; # Turn off Data::Checks in this scope ...; # but strict and warnings have also been disabled! }...
Unlike other primitive `BOOL` should accept `undef` as well. There are tons of existing code returning `undef` as false. IMHO it's not good idea forcing users to change their existing...
# Motivation / Goal Nowadays common usage of Perl programs is some kind of backend. There it usually needs 3 types of `checks` (better word here will be `contract`) -...
Example: ``` my @list : (Array[ max_length (7), Int ]; if ($list[8]) { # should this fail? } ```