The compiler seems to be deducing that "xrender genXML'" needs to be of type "XmlOutput ByteString"
No, the compiler deduces (from the use of BSL.putStr
) that xrender genXML'
needs to be of type Data.ByteString.Lazy.ByteString
.
Since the type of xrender
is
xrender :: (Renderable r, XmlOutput t) => Xml r -> t
a necessary condition to be able to instantiate t
with Data.ByteString.Lazy.ByteString
is an XmlOutput
instance for lazy ByteString
s.
Since there is such an instance exported from Text.XML.Generator
, the only cause for the error message that I see is that your
import Data.ByteString.Lazy as BSL
imports the module from a different version of the bytestring
package than the xmlgen
library was built against.
Can you check that with ghc-pkg describe xmlgen
, which lists the bytestring
version it was built against among the dependencies, and ghc-pkg list bytestring
to check which bytestring
versions you have installed?