From: Matt S Trout Date: Thu, 16 Feb 2017 19:12:09 +0000 (+0000) Subject: add types to Proposition and PropositionSequence X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FDX.git;a=commitdiff_plain;h=a97779a16ec8afef233e00d91d541d4972fa0fd0 add types to Proposition and PropositionSequence --- diff --git a/lib/DX/Proposition.pm b/lib/DX/Proposition.pm index b682392..1415276 100644 --- a/lib/DX/Proposition.pm +++ b/lib/DX/Proposition.pm @@ -5,11 +5,11 @@ use DX::Class; has predicate => (is => 'ro', isa => Str, required => 1); -has args => (is => 'ro', isa => ArrayRef, required => 1); +has args => (is => 'ro', isa => ArrayRef[Str|Value], required => 1); -has introduced_names => (is => 'ro', isa => HashRef, required => 1); +has introduced_names => (is => 'ro', isa => HashRef[One], required => 1); -has required_names => (is => 'ro', isa => HashRef, required => 1); +has required_names => (is => 'ro', isa => HashRef[One], required => 1); sub resolve_for { my ($self, $scope) = @_; diff --git a/lib/DX/PropositionSequence.pm b/lib/DX/PropositionSequence.pm index 2b4e8a4..1756e15 100644 --- a/lib/DX/PropositionSequence.pm +++ b/lib/DX/PropositionSequence.pm @@ -1,13 +1,13 @@ package DX::PropositionSequence; -use Types::Standard qw(ArrayRef HashRef); +use Types::Standard qw(HashRef); use DX::Class; -has members => (is => 'ro', isa => ArrayRef[Proposition], required => 1); +has members => (is => 'ro', isa => PropositionList, required => 1); -has external_names => (is => 'ro', isa => HashRef, required => 1); +has external_names => (is => 'ro', isa => HashRef[One], required => 1); -has internal_names => (is => 'ro', isa => HashRef, required => 1); +has internal_names => (is => 'ro', isa => HashRef[One], required => 1); sub new_empty { shift->new(