Hi all,

i'm having a bit of difficulty using GHCi to try out HXT.

i brought the Text.XML.HXT.Arrow module into scope using :m. Then i entered:

        let contact = mkelem "stream:stream" [ sattr "xmlns:stream" 
"http://etherx.jabber.org/streams";, sattr "xmlns" "jabber:client", sattr "to" 
"livejournal.com" ] []

and got the error message: 

        <interactive>:1:14:
        Ambiguous type variable `a' in the constraint:
        `ArrowXml a' arising from use of `mkelem' at <interactive>:1:14-19
        Probable fix: add a type signature that fixes these type variable(s)

The type signature of mkelem is

        mkelem :: (ArrowXml a) =>
        String -> [a n XmlTree] -> [a n XmlTree] -> a n XmlTree

So then i modified it to:

        let contact = mkelem "stream:stream" [ sattr "xmlns:stream" 
"http://etherx.jabber.org/streams";, sattr "xmlns" "jabber:client", sattr "to" 
"livejournal.com" ] [] :: ArrowXml a => a XmlTree XmlTree

And got:

        <interactive>:1:14:
        Ambiguous type variable `a' in the constraint:
        `ArrowXml a'
        arising from instantiating a type signature at <interactive>:1:14-194
        Probable fix: add a type signature that fixes these type variable(s)

i don't understand why i need to specify type signatures when they should 
already be in scope? And if i /do/ need to specify the type signatures for 
some reason, how do i do so in a manner that works?

Any help much appreciated!


Alexis.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to