a library mimicking ghc-pkg list function