on 5054813 help sign in
streamly/INSTALL.md
82 lines 1.9 kB history raw
1# Using `streamly` package
3* [Latest stable release](https://hackage.haskell.org/package/streamly) is available on
4 Hackage.
5* [Latest development version](https://github.com/composewell/streamly) is
6 available on github.
7* See [recommended compilation options here](docs/Build.md).
9If you are using `stack` or `nix` please make sure to add the latest version
10from Hackage to your tool configuration.
12## Using with `cabal`
14Make sure you have `cabal` version 2.4 or later installed and you have `ghc`
15available in your PATH. Refresh your package list:
17```
18$ cabal v2-update
19```
21### Using hackage version in repl
23```
24# Run repl with the latest version from Hackage
25$ cabal v2-repl --build-depends streamly
27# Run repl with a specific version from Hackage
28$ cabal v2-repl --build-depends streamly==0.6.1
29```
31### Using github version in repl
33Create a directory for your playground (e.g. `test`) and create a
34`cabal.project` file in it as follows:
36```
37packages: .
38source-repository-package
39 type: git
40 location: https://github.com/composewell/streamly
41 tag: master
42```
44Create a cabal file (e.g. `test.cabal`) as follows
46```
47cabal-version: 2.4
48name: test
49version: 0
51library
52 build-depends: base, streamly
53```
55Run repl:
57```
58$ cabal v2-repl
59```
61### Compiling with ghc
63```
64$ cat hello.hs
65import qualified Streamly.Prelude as S
67main = S.runStream $ S.fromListM [putStrLn "hello", putStrLn "world"]
68```
70```
71$ cabal v2-install streamly-0.6.1
72$ ghc -package streamly-0.6.1 hello.hs
73```
75### Using in a Project
77Add `streamly` to the `build-depends` section of your library/executable in
78your `<package>.cabal` file. Appropriate version from Hackage will be picked
79depending on the version bounds that you specify. See the `github version in
80repl` section above for a sample `<package>.cabal` file and optionally the
81`cabal.project` file if you want to use the development version from github in
82your project.