
On Friday 25 November 2011, 01:32:13, Tim Pizey wrote:
Hi,
I have installed cabal and HaxMl
cabal install HaXml
but my .hs file cannot find
import Text.XML.HaXml.Xml2Haskell (readXml)
giving
*** Chasing dependencies: Chasing modules from: *ch.hs
ch.hs:3:8: Could not find module `Text.XML.HaXml.Xml2Haskell': locations searched: Text/XML/HaXml/Xml2Haskell.hs Text/XML/HaXml/Xml2Haskell.lhs
It would seem only to be looking in the current directory.
Hoping I have just missed something obvious.
In a way. Text.XML.HaXml.Xml2Haskell was in HaXml-1.13, but is no longer in HaXml since version 1.19 (current is 1.22.5). Old tutorial, I guess. There are two functions with the name readXml in the new versions, in Text.XML.HaXml.XmlContent and Text.XML.HaXml.XmlContent.Haskell (probably the same function, just exported from both modules). The type has changed, instead of XmlContent a => String -> Maybe a, it is now XmlContent a => String -> Either String a, presumably specifying the parse failure now if there is one, otherwise I expect the behaviour to be the same.