Is there a way to clone Hackage packages using command line tools?

Viewed 48

By that I mean clone them similarly to Github repos. 3.5 years ago I remember doing that in order to study some Haskell libraries, but after a long hiatus the way to do this from the command line using a tool like stack or cabal completely escapes me. I know that the package pages do have a direct tarball download at the bottom, but I remember there being something else. Just installing them gets rid of the sources, so that is not what I am looking for here.

1 Answers

You may

cabal unpack package-name

to get the latest version of package-name that cabal knows about, or

cabal unpack package-name-4.20

to get version 4.20 of package-name.

Related