@@ -4,16 +4,16 @@ Getting Started
4
4
Installing Cabal
5
5
----------------
6
6
7
- The easiest and recommended way to install the ``cabal `` command-line tool
8
- on Linux, macOS, FreeBSD or Windows is through `ghcup <https://www.haskell.org/ghcup/ >`__.
7
+ The easiest and recommended way to install the ``cabal `` command-line tool
8
+ on Linux, macOS, FreeBSD or Windows is through `ghcup <https://www.haskell.org/ghcup/ >`__.
9
9
It installs the “Haskell toolchain”, which includes Cabal,
10
- the Haskell compiler `GHC <https://www.haskell.org/ghc/ >`__
10
+ the Haskell compiler `GHC <https://www.haskell.org/ghc/ >`__
11
11
and optionally other useful Haskell tools.
12
12
13
13
Creating a new application
14
14
--------------------------
15
15
16
- We create a minimal Haskell application to get a quick overview
16
+ We create a minimal Haskell application to get a quick overview
17
17
of the ``cabal `` command-line tool:
18
18
19
19
1. How to initialize a Haskell package.
@@ -59,9 +59,9 @@ The ``myapp.cabal`` file is a package description file, commonly referred to as
59
59
default-language: Haskell2010
60
60
61
61
It contains metadata (package name and version, author name, license, etc.) and sections
62
- to define package components. Components can be used to split large codebases into smaller,
62
+ to define package components. Components can be used to split large codebases into smaller,
63
63
more managable building blocks.
64
- A component can be of one of several types (executable, library, etc.) and describes,
64
+ A component can be of one of several types (executable, library, etc.) and describes,
65
65
among other things, the location of source files and its dependencies.
66
66
The ``myapp.cabal `` file above defines a single component named ``myapp `` of the executable type.
67
67
Inside the ``executable `` section, the ``build-depends `` field lists the dependencies of this component.
@@ -77,7 +77,7 @@ The ``app/Main.hs`` file is where your executable's code lives:
77
77
main = putStrLn "Hello, Haskell!"
78
78
79
79
80
- To run the executable, switch into the application directory with ``cd myapp `` and run
80
+ To run the executable, switch into the application directory with ``cd myapp `` and run
81
81
82
82
.. code-block :: console
83
83
@@ -86,7 +86,7 @@ To run the executable, switch into the application directory with ``cd myapp`` a
86
86
Hello, Haskell!
87
87
88
88
This command automatically determines if the executable needs to be (re)built
89
- before running the executable. With only one executable component in the package,
89
+ before running the executable. With only one executable component in the package,
90
90
``cabal run `` (without a component name) is smart enough to infer it, so the name can be omitted.
91
91
92
92
If you just want to build the executable without running it, run:
@@ -181,11 +181,11 @@ Now you can build and re-run your code to see the new output:
181
181
Running a single-file Haskell script
182
182
------------------------------------
183
183
184
- Cabal also supports running single-file Haskell scripts like
184
+ Cabal also supports running single-file Haskell scripts like
185
185
the following file named ``myscript ``:
186
186
187
187
.. code-block :: haskell
188
-
188
+
189
189
#!/usr/bin/env cabal
190
190
{- cabal:
191
191
build-depends:
0 commit comments