Subject: | change API : single-argument does(..) would check against $_ |
Maybe it's too late to change the API ... but nevertheless here is a
suggestion :
The fact that does(..) returns a curried function when called with one
single argument doesn't seem very useful to me. Actually, I peeked into
the module tests, and this feature doesn't even seem to be tested.
On the contrary, what could be quite useful would be if the single-arg
version checked against $_ (i.e. does($role) would be equivalent to does
($_, $role)). When used together with given/when, this would yield :
given ($data) {
when(does('ARRAY')) {...}
when(does('HASH')) {...}
...
}
This would be quite elegant, don't you think ?