final case classLabeledElement(label: ResolvedName, element: Element) extends Node with Product with Serializable
First - why we need different entities than plain scala-xml ones?
The problem appeared when testing lawfulness of Optional[Elem, NonEmptyList[Elem]]
It was impossible to satisfy get what you set law as modify function may
modify label which at the same time is the key for a lookup.
// just pseudo-code - elem is not a case class so it has no copy
val res = elemOptional.get("abc").modify(_.copy(label = "someNewLabel"))
res.get("abc") // will return None instead of modified elem...
To restrict user not to modify label of "zoomed-in" element we need to create our own Element
Linear Supertypes
Serializable, Serializable, Product, Equals, Node, AnyRef, Any
First - why we need different entities than plain scala-xml ones?
The problem appeared when testing lawfulness of Optional[Elem, NonEmptyList[Elem]] It was impossible to satisfy
get what you set
law asmodify
function may modifylabel
which at the same time is the key for a lookup.// just pseudo-code - elem is not a case class so it has no
copy
val res = elemOptional.get("abc").modify(_.copy(label = "someNewLabel")) res.get("abc") // will return None instead of modified elem...To restrict user not to modify label of "zoomed-in" element we need to create our own Element