
Hi, I am trying to read a .cabal find and print the package name and version. Here is the code snippet: === Code === getName :: FilePath -> IO () getName cabal = do gdesc <- readPackageDescription normal cabal let desc = flattenPackageDescription gdesc final = pkgName $ package desc putStrLn final === END === === Output === Couldn't match expected type `[Char]' with actual type `PackageName' === END === I see that the method 'package' from: http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution... allows me to return the PackageIdentifier. Using pkgName returns a PackageName. http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution... But, how can I obtain the string value from it? Appreciate any help in this regard. Thanks! SK -- Shakthi Kannan http://www.shakthimaan.com