Facts are currently all strings. Consider converting structured which makes them to Boolean and Numeric values (at have different type. Their type is however not defined anywhere which means that different fat providers can return a minimum) at different data type. In general, a node's facts defines the boundary (when they majority of the input to compilation. Since their types are set as variables) not defined it makes type inference impossible.
Consider having dual mode (accesses as top scope variables == string, accessed as fact[key] is typed.
DesignWe should have a mechanism that allows facts to declare be typed using the type of a fact in Facter Puppet Type system. (Using We should assert that facts have the puppet correct type system).
(There may be other issues related to this; typed facts) should ideally be done by facter, but decisions have to can be made done by the compiler).
This issue relates to PP-477 The type of each fact (strict numbersand the fact that it exists, should be available statically and declarative to enable validation as early as in parsing manifests).
Facts are currently structured which makes them have different type. Their type is however not defined anywhere which means that different fat providers can return a different data type. In general, a node's facts defines the majority of the input to compilation. Since their types are not defined it makes type inference impossible.
We should have a mechanism that allows facts to be typed using the Puppet Type system. We should assert that facts have the correct type (this should ideally be done by facter, but can be done by the compiler). The type of each fact (and the fact that it exists, should be available statically and declarative to enable validation as early as in parsing manifests). Making facts typed would also help in delivering facts derived from ENV variables as it could deliver them as a better data type than a String.
I would really like facts to be type - as it is now you have no idea what the data type of something is. At some point we want to have rich type support in facts as well - then they need to be serialized.