Variable in Kabbalah (Haskell)

I am trying to write a package in Haskell. This package contains a library and an executable file. I indicate this in the Cabal file. There are three main components of the library:

1) There are open library modules

2) There are internal assembly dependencies that should not be exported as part of the library

3) There are external build dependencies.

The Cabal file is slightly overlapping. For the library, I write:

open modules: list of open modules

other modules: List of other modules

build-depends: list of build dependencies

Then for the executable file Other modules: a list of open modules and other modules is needed in the executable file build-depends: list of build dependencies

Which would be nice if Cabal allows me to have a variable.

V1 = List of open modules

V2 = List of other modules

V3 = Build list dependencies

Then in the executable, for example, I could do

other modules: V1, V2

build-depends: V3

As an alternative, I would recommend using Cabal better!

+4
source share
1 answer

No, this is not yet possible. I think we have a function request for something similar in the question tracker. Please note, however, that your executable may depend on the library defined in the same .cabal file, so you do not need to share exposed-modules and other-modules :

 Name: some-package Version: 0.1 [...] Library build-depends: some-dependency >= 1.0, ... exposed-modules: A, B, C other-modules: C, D, E [...] Executable some-exe main-is: SomeExe.hs build-depends: some-package == 0.1 

For an example in the real world, see here .

+2
source

Source: https://habr.com/ru/post/1501373/


All Articles