=begin pod

=TITLE role Callable

=SUBTITLE Invocable code object

    role Callable { ... }

Role for objects which support calling them. It's used in L<Block>,
L<Routine>, L<Sub>, L<Method>, L<Submethod> and L<Macro> types.

Callables can be stored in C<&>-sigiled containers, the default type constrain
if such a container is C<Callable>. A signature object can be used to
force a check against the signature of the Callable to be stored into the
congtainer.

	my &a = {};
	my &b = -> {};
	my &c = sub () {};
	sub foo () {};
	my &d = &foo;
	my &f:(Int) = sub bar (Int) {};
	my &f:(Str) = -> Str {};

=head1 Methods

=head2 method assuming

    method assuming (Callable:D $self: |primers)

Returns a C<Callable> that implements the same behaviour as the
original, but has the values passed to .assuming already bound to the
corresponding parameters.

    sub add(Int $x,Int $y) { $x + $y };
    my &add_to_5 = &add.assuming(5);
    say add_to_5(4); #-> 9

=comment according to design docs it's Callable but in rakudo it's assuming is in Block

=head1 Operators

=head2 C<< infix:<∘> >>

The function combinator C«infix:<∘>» or C«infix:<o>» combines two functions of arity one, so that the left function is called with the return value of the right function.

    sub f($p){ say 'f'; $p / 2 } 
    sub g($p){ say 'g'; $p * 2 } 
    my &f-g = &f ∘ &g; 
    say f-g(2); # OUTPUT«g␤f␤2␤»

=end pod
