Retrieving names of modules included in a cabal package from parsing the .cabal file

倾然丶 夕夏残阳落幕 提交于 2019-12-06 03:28:05

问题


I wonder if there is a way to retrieve the module names of a cabal package from parsing the .cabal files.

I have tried to use parsePackageDescription from Distribution.PackageDescription.Parse but for instance when I try parsing the .cabal of the Cabal package itself (http://hackage.haskell.org/package/Cabal-1.18.1.2/Cabal.cabal) the library value of PackageDescription is Nothing even though there is a library section with both exposed-modules and other.modules in the .cabal file.

Is this intended or am I doing anything wrong? Also, if it is intended, does anyone know any other simple way of retrieving the modules names?

Thanks in advance!

来源:https://stackoverflow.com/questions/22785670/retrieving-names-of-modules-included-in-a-cabal-package-from-parsing-the-cabal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!