Lucas Sampaio
Lucas Sampaio

Reputation: 1578

How to pin dependencies in Haskell apps

I'm writing a todo.sh in Haskell now, to understand better how IO monads work, and I'm going to use cmdArgs to parse input, like argparse do in Python.

My question is, how can I pin the dependency of cmdArgs like pip's requirements.txt?

Django==1.5.1
South==0.7.6

And, is it ok distribute my package in Hackage?

Upvotes: 5

Views: 287

Answers (1)

Daniel Fischer
Daniel Fischer

Reputation: 183978

Use the build-depends field in your .cabal file

build-depends:
    cmdargs == 0.10.3

But specifying one exact version is usually not the best idea, so

build-depends:
    cmdargs >= 0.8 && < 0.11

specifies a range of admissible versions.

And, is it ok distribute my package in Hackage?

Not if you know that it won't ever be useful to anyone.

In other words, yes, sure it is okay. You need an account on Hackage for that, and that may take some time to obtain, though.

Upvotes: 6

Related Questions