Reputation: 2093
I have developed a module (M.hs) which depends upon 3 other modules (A.hs, B.hs and C.hs). Now I want to use the module M across multiple other projects. So I have to install this module. But for learning purpose I don't want to use cabal, I want to do it manually. I want to install it in my home dir.
What is a proper course of action? Which files to be created, copied? where? How to use this module in other project?
Additional info:
Upvotes: 1
Views: 347
Reputation: 25763
You say you don’t want to use cabal
, but would you use Cabal
?
cabal is the name of the command line tool provided by cabal-install which can download packages from Hackage and resolve dependencies.
Cabal is the library that Haskell code uses to drive the compilation (e.g. pre-process files, build in the right order, build variants, generate documentation) and install into the right location.
I would not recommend not using Cabal
, even for learning purposes, until you want to write a replacement for it. But if you really want to do it, here is the rough outline, with enough details to figure out for a good learning experience:
-package-name yourpkgname-version
.libyourpkgname-version.a
file./var/lib/ghc/package.conf.d/mtl-2.1.2.conf
, and pay attention to name
, `exposed-modules
, import-dirs
, library-dirs
and hs-libraries
ghc-pkg register
Upvotes: 2