Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 278
Lucas Sampaio Avatar asked Apr 29 '13 17:04

Lucas Sampaio


1 Answers

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.

like image 122
Daniel Fischer Avatar answered Nov 02 '22 05:11

Daniel Fischer