on master help sign in
Update setup/usage guide for new cabal versions
commit74c942641995b5f86eb3b230013303a42e8f3cb5 authorHarendra Kumar <harendra@composewell.com> dateTue 14 Mar 2023, 01:22 (4 years ago) parent9596aea
1 file changed+21−3
docs/User/Tutorials/setup-and-usage.md+21−3
docs/User/Tutorials/setup-and-usage.md+21−3
@@ -112,7 +112,7 @@ project files:
112112
113113```
114114$ cd streamly-project
115−$ cabal init --minimal --dependency base --dependency streamly-core
115+$ cabal init --non-interactive --minimal --dependency base --dependency streamly-core
116116
117117...
118118Generating app/Main.hs...
@@ -128,8 +128,21 @@ cabal file `streamly-project.cabal`. Please see the [Cabal User
128128Guide](https://www.haskell.org/cabal/users-guide/) for more information
129129on `.cabal` files.
130130
131−This invocation also creates a skeletal `app/Main.hs` file which we
132−will now use to write our streamly based program.
131+IMPORTANT: Because of a bug in cabal 3.8, which is fixed in cabal 3.10,
132+this does not generate a dependency on `base`, please edit the generated
133+cabal file and add `base` in the `build-depends` section:
134+
135+```
136+ build-depends: base, streamly-core
137+```
138+
139+This invocation also creates a skeletal `app/Main.hs`, therefore, we can
140+compile and run it right away:
141+
142+```
143+$ cabal run
144+Hello, Haskell!
145+```
133146
134147### Import `streamly` modules in the project code
135148
@@ -165,6 +178,11 @@ To start up the GHCi REPL for your project, please use:
165178```
166179$ cabal repl
167180...
181+Ok, one module loaded.
182+ghci> main
183+1
184+2
185+3
168186ghci>
169187```
170188