10/11/2023 0 Comments Cabal code zero leveling guideYou will see that the fields that have yet to be filled in are commented out. cabal file has the package metadata and towards the end of the file you will find the executable or library section. cabal file and add a Description field.Īs this stage the proglet.cabal is not quite complete and before you are able to build the package you will need to edit the file and add some build information about the library or executable. cabal file can be edited afterwards.įinally, cabal init creates the initial proglet.cabal and Setup.hs files, and depending on your choice of license, a LICENSE file as well. For more complex packages (e.g. a library and multiple executables or test suites) the. What does the package build:įor the moment these are the only choices. Libraries are collections of Haskell modules that can be re-used by other Haskell libraries and programs, while executables are standalone programs. One of the important questions is whether the package contains a library or an executable. For a package that you never intend to distribute to others, these fields can be left blank. It also asks questions about various other bits of package metadata. It asks us a number of questions starting with the package name and version. We can create both files manually or we can use cabal init to create them for us. Setup.hs: usually containing a few standardized lines of code, but can be customized if necessary. Proglet.cabal: containing package metadata and build information. To turn this into a Cabal package we need two extra files in the project’s root directory: This simple example has all the project files in one directory, but most packages will use one or more subdirectories. It is assumed that (apart from external dependencies) all the files that make up a package live under a common project root directory. Lets assume we have created a project directory and already have a Haskell module or two.Įvery project needs a name, we’ll call this example “proglet”. Meaning of field values when using conditionals.Explicit dependencies and automatic package management.Kinds of package: Cabal vs GHC vs system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |