(PUP-2831) Make Puppet work with RGen 0.7.0

This updates the Gemfile to use RGen 0.7.0 (optionally).
In RGen 0.7.0 containment now works as specified, if something is
contained more than once, it moves to the last container that contains
it (by removing it as contained from all other containers). This caused
problems in the Function API where the block default Callable type was
reused for all signatures (and thus moved). There were also problems in
tests where the same type instances was contained in multiple locations.

This fixes these to use distinct instances.
(maint) Remove dead code
(PUP-2833) Make all types inherit PAnyType

Some types inherited PAbstractType (to indicate they where not
concrete). This just causes confusion when using the Ruby API
to check if a Type is PAnyType.

This makes all types inherit from PAnyType (which is the only
type inheriting from PAbstractType).
(PUP-2794) Change Callable to mean "can be called with"

It is more meaningful to check that a Callable can be called with
certain types (exact or more generic) than to check the reverse.

This alters the meaning of Callable assignability so that a more generic
Callable is accepted. While this seems counterintuitive from the
perspective of the type system, it is the constraint that is expected as
the constraint being expressed means "Must be callable with arguments of
these types", and a more generic callable is just that.

The current implementation got that wrong, and will actually accept
callables that can in fact not be called.

This also alters the assert_type function that declared that it would
call a given block with Any, Any, when in fact it will call with
Type, Type.

Note, that a function that after this delares that it calls
Callable[Any] will enforce that the given callable is Any. If the intent
is to accept any callable, the type should be given as just Callable.
(PUP-2794) Add an (internal) type called Unit and use in Callable

This adds a type named Unit, that is an "undef of sort" in that
it is assignable to anything, and anything can be assigned to it.

This type is not exposed in the Puppet Language, and it is only
used in Callables to describe that there is no type requirement on
a parameter. (For cases where reflection of a given lambda is
performed etc. or where the error raised when calling a block
is an acceptable solution).
(PUP-2794) Add support for Optional and Variant as Callable

This adds support for a callable block to be specified using
Optional or Variant, as long as any actual type is a Callable.

I.e. in the Function API, it is possible to write:

  required_block_param 'Variant[Callable[1,1], Callable[2,2]]', :block

If the function will invoke the block with either exactly one or
exactly two parameters (and when no type is specified, the type is the
internal Unit (don't care).
(PUP-2794) Change function each to dispatch based on block arity

This changes the implementation of the each function to use different
dispatchers depending on the arity of the given block. This means that
the included module for asserted_serving_size is no longer needed.
(PUP-2794) Change function filter to use dispatch for block arity

This changes the function filter to use the dispatchers instead
of having a special arity check.
(PUP-2794) Change function filter to use dispatch for block arity

This changes the function filter to use the dispatchers instead
of having a special arity check.
(PUP-2794) Change function reduce to use dispatchers for block arity

This changes the reduce function to use the dispatchers to check
the block arity.
(PUP-2794) Remove dependency on iterative common module from slice func
(PUP-2794) Modify the shared spec for iterative functions

This updates the shared tests for iterative functions to also
be capable of handling reduce. This also adds missing tests
that were part of one of the individual tests earlier.

The test for reduce now also invokes the shared behavior for argument
checking.
(PUP-2794) Cleanup dead code and fix spacing in tests
(PUP-2794) Remove Util::Functions::IterativeSupport

This removes the now unused Puppet::Util::Functions::IterativeSupport
as it is no longer being used. The smaller check is now part of each
function, and the block arity checking is done declaratively using
an apropriate Callable type for the functions' block_type.
(PUP-2794) Fix problem with check for >0 params

There was a problem with the check for empty range, as the size
of a range Integer[0,0] is not 0, but 1 (there is a 0 in the range).

Also adds test to check that type parser produces a Callable with
a Unit type when the range so requires.
(PUP-2794) Fix failing test after correction of has types > 0 check
(maint) Move the interative functions shared behavior to common dir

This commit moves the shared behavior for iterative functions to
shared_behaviours/iterative_functions.
(PUP-2858) Remove e_parser adapter support

This removes support for the hybrid future parser/old evaluator
by changing the ParserFactory to always select the future parser/
new evaluator combination. As a consequence, the EParserAdapter
is no longer needed and it is now dropped together with its tests.
(PUP-2858) Deprecate the use of Puppet[:environment] == current

This changes defaults.rb to deprecate the use of :environment = :current
The future evaluator is always picked by the Parser::Factory and
the setting has no effect. It may have effect in future versions of
Puppet (for additional experiments when Puppet 4.0 is released). For
that purpose, the settings is not completely removed.
(PUP-2858) Remove use of Puppet[:evaluator] from the code base

This removes all usage of Puppet[:evaluator] from the code base
since it is (in this version) enough to check if Puppet[:parser] is
'future' as the future evaluator is always used.