Description
Currently our DPath runtime (and, I believe, main infoset) pass around values of type AnyRef, which affords almost no protection through the Scala type system.
This was done to avoid the boxing overhead normaly associated with creating case classes. However, it should be possible to create an unboxed type that can provide some level of type safety.
Simmilar to our current Maybe type, can can create a new value type that wraps AnyRef. Being a value type, it will not require boxing. We can then make the main constructor hidden, and provide constructors only for those types that we want to allow as DPath variables.
This should provide us type safty in assiging to DPath variables. Reading the values will still involve dealing with AnyRef however.