Alaya
Alaya

Reputation: 3387

What is the common workflow of using cabal for personal project?

Assume I want to creat my own local library called MyLib, my workflow is:

$ cabal init
# # edit the ".cabal" file, set the "exposed-modules" as "MyLib"
# # edit "MyLib.hs" located in "src"
$ cabal sandbox init
$ cabal install

So my question is

Upvotes: 2

Views: 257

Answers (1)

NovaDenizen
NovaDenizen

Reputation: 5305

I've never used cabal sandbox so I can't speak much to it.

cabal build compiles your source code into your dist directory.

cabal install takes your compiled source code and sends it to your ~/.cabal directory, and registers it in your ~/.ghc directory. Now you can import it into other code just as you would any other library you've installed with cabal.

In my personal projects, I use cabal configure, cabal build, cabal repl, and cabal install. And configure is kind of optional.

Upvotes: 2

Related Questions