Num => sub { !ref($_) && looks_like_number($_) },
Int => sub { defined($_) && !ref($_) && /^-?[0-9]+$/ },
Str => sub { defined($_) && !ref($_) },
- ClassName => sub { 1 },
+ ClassName => sub { Mouse::is_class_loaded($_) },
Ref => sub { ref($_) },
ScalarRef => sub { ref($_) eq 'SCALAR' },
1;
+__END__
+
+=head1 NAME
+
+Mouse::TypeRegistry - simple type constraints
+
+=head1 METHODS
+
+=head2 optimized_constraints -> HashRef[CODE]
+
+Returns the simple type constraints that Mouse understands.
+
+=cut
+
+