Search code examples
haskellhaskell-stack

Where can I find correct package name and version for Haskell?


Say, I need System.Eval.Haskell. Or whatever else. How do I know which package I should specify in my package.yaml? When I go to the https://hackage.haskell.org/package/plugins-1.5.7/docs/System-Eval-Haskell.html, I see no package name.

P.S. "plugins" did not work for me. Thus, I assume it's something different. I hope so :)


Looks like there is somewhat quite unclear difference between extra-dependencies and "regular" dependencies in the configuration. Mentioning plugins-1.5.7 as extra-dep indeed works. Am I doing some dependency mismanagement here, or that's green way to go?


Solution

  • Looks like there is somewhat quite unclear difference between extra-dependencies and "regular" dependencies in the configuration. Mentioning plugins-1.5.7 as extra-dep indeed works. Am I doing some dependency mismanagement here, or that's green way to go?

    That's how it is supposed to be. The issue is that there are two major archives of Haskell packages: Hackage, which includes basically every package and every version ever, and Stackage, which is a large subset of Hackage bundled into snapshots of mutually compatible packages and versions. Stack defaults to drawing packages from Stackage, so if you want to use a package from Hackage that is not in Stackage you have to also add it to the extra-deps of stack.yaml. Whether a package is in Stackage can be found the contents page of the package in the Hackage docs (if it is on Stackage, there will be an entry for it in the "Distributions" field). Also relevant is Stackage Hoogle, which lets you search for package names, modules and identifiers within a Stackage snapshot.

    P.S.: For more on the relationship between Hackage, Stackage and Stack, you might have a look at my answer to What is the difference between Cabal and Stack? (You may replace any mentions of "the .cabal file" there by "package.yaml", if that's what you are using.)