I'm fairly beginnerish. I'm trying to use HaXml with MusicXML. I got a hold of the MusicXML DTD and ran DtdToHaskell. It generated a file which I then attempted to import to a test program. I got a few compiler errors about duplicate definitions and ambiguous definitions. It seemed pretty clear that these resulted from names in the DTD clashing with each other or with existing names, and I just tweaked some of those. Those compile errors went away. However, I have a new set of compiler errors. I'm getting a similar error hundreds of times, namely "Couldn't match expected type Text.XML.HaXml.Types.QName with actual type "String". Poking around, I found this webpage describing an issue with a change to HaXml that happened after version 1.20.2: < http://stackoverflow.com/questions/7501037/how-to-make-haxml-and-drift-work-...
This web page suggests that I need to install HaXml-1.20.2 to use it with the current version of the DtdToHaskell utility. Note that I already have the latest version of HaXml installed, so I would need to replace it with an older version. I tried running cabal install HaXml-1.20.2 but got "Ambiguous model name 'Prelude': it was found in multiple packages: base haskel98-2.0.0.1" This sounds like something fundamental about the Haskell packages but I don't know enough to know what to do. Mike
On Fri, Nov 9, 2012 at 6:04 PM, Michael Mossey <mpm@alumni.caltech.edu>wrote:
but got "Ambiguous model name 'Prelude': it was found in multiple packages: base haskel98-2.0.0.1"
This sounds like something fundamental about the Haskell packages but I don't know enough to know what to do.
Modern GHC can't mix haskell98-style flat module names like Char or IO with the current Haskell standard's hierarchical libraries. The first step to fixing this is to remove the haskell98 dependency from the cabal file; the next is to track down and replace any imported modules that are found to be missing: for example, Char is now Data.Char and IO is split over a number of modules in the System.IO hierarchy. You can use Hoogle or Hayoo (Haskell-specific search engines) to find the module that provides a given function. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix/linux, openafs, kerberos, infrastructure http://sinenomine.net
On 9 Nov 2012, at 23:04, Michael Mossey wrote:
"Couldn't match expected type Text.XML.HaXml.Types.QName with actual type "String".
Poking around, I found this webpage describing an issue with a change to HaXml that happened after version 1.20.2:
<http://stackoverflow.com/questions/7501037/how-to-make-haxml-and-drift-work-with-ghc-7-0-3>
This web page suggests that I need to install HaXml-1.20.2 to use it with the current version of the DtdToHaskell utility.
For the record (and future web searches), this issue with HaXml (DtdToHaskell generating non-compilable code) was fixed in version 1.23 onwards, from around April 2012. Regards, Malcolm
participants (3)
-
Brandon Allbery -
Malcolm Wallace -
Michael Mossey