NAME
FP::Abstract::Sequence - functional sequence protocol
SYNOPSIS
use FP::Predicates "is_sequence"; # since we can't have it in
# FP::Abstract::Sequence
use FP::PureArray;
use FP::StrictList;
use FP::List;
use FP::Stream;
use FP::Array 'array';
use Chj::TEST;
TEST { list(purearray(3,4),
strictlist(3,4),
list(3,4),
stream(3,4),
cons(3,4), # ok this can't really count as a sequence,
# what to do about it?
array(3,4), # Could `autobox` change this?
3,
{3=>4},
)->map(*is_sequence)->array }
[ 1,1,1,1,1,'','','' ];
DESCRIPTION
This is a functional protocol, i.e. its use does not exert any side effects. It does *not* imply `FP::Sequence::Pure`, though; impure data structure might like to implement it all the same.
XX This is a work in progress. More base implementations should be moved here, etc.
Also, methods that are only implemented here are inconsistent in that they can't be imported as functions from any module. Should we really move functions over as plain wrappers across method calls (only?). Although perhaps it's fair to (only) have those functions importable under a type specific name that have type specific implementations.
SEE ALSO
NOTE
This is alpha software! Read the package README.