~singpolyma/xml-types-haskell

4c6a20ec9f46aa1246da65ee7db91c0d7d0e142a — Stephen Paul Weber 11 months ago 850b0af
New IsString instances

Allows for convenience construction of attribute Content and text nodes.
1 files changed, 4 insertions(+), 0 deletions(-)

M lib/Data/XML/Types.hs
M lib/Data/XML/Types.hs => lib/Data/XML/Types.hs +4 -0
@@ 174,6 174,8 @@ instance NFData Node where
	rnf (NodeContent a)     = rnf a `seq` ()
	rnf (NodeComment a)     = rnf a `seq` ()

instance IsString Node where
	fromString = NodeContent . fromString

data Element = Element
	{ elementName :: Name


@@ 208,6 210,8 @@ instance NFData Content where
	rnf (ContentText a)   = rnf a `seq` ()
	rnf (ContentEntity a) = rnf a `seq` ()

instance IsString Content where
	fromString = ContentText . fromString

-- | A fully qualified name.
--