streamly/streamly.cabal
2017-12-01 14:34:46 +05:30

277 lines
9.1 KiB
Plaintext

name: streamly
version: 0.1.0
synopsis: Beautiful Streaming, Concurrent and Reactive Composition
description: Streamly unifies concurrency and streaming in a single monad
transformer with a concise and simple API. It provides two ways to combine
streams, a monadic product composition as well as the standard pipelined
composition provided by streaming libraries. A natural extension of regular
monadic composition to streaming and concurrency makes it intuitive and
concise with almost universal application. You can write concurrent or
non-concurrent applications using simple IO, logic programming, streaming IO
or reactive programming (FRP) using the same API. You can also think about it
as representing concurrent and composable state machines in imperative terms.
It unifies the core functionality provided by
<https://hackage.haskell.org/package/async async>,
<(https://hackage.haskell.org/package/logict logict>,
<https://hackage.haskell.org/package/list-t list-t>,
<https://hackage.haskell.org/package/conduit conduit>\/<https://hackage.haskell.org/package/pipes pipes>,
<https://hackage.haskell.org/package/Yampa Yampa>\/<https://hackage.haskell.org/package/reflex reflex>
under one type and API. It interworks with the existing streaming libraries.
.
Streamly provides high level concurrency primitives (higher level than async)
and hides the low level concurrency details completely from the programmer.
Concurrency can be used with ease in applicative or monadic contexts. The
programmer just expresses whether a task can run in parallel with another.
Threads, synchronization and concurrency rate control are handled
automatically under the hood. The concurrency facilities provided by streamly
can be compared with <https://en.wikipedia.org/wiki/OpenMP OpenMP> and
<https://en.wikipedia.org/wiki/Cilk Cilk> but with a more declarative
expression. Concurrency support does not compromise performance in
non-concurrent cases, the performance of the library is at par or better than
most of the existing streaming libraries.
.
Here is a simple example to concurrently and recursively list the contents of
a directory tree:
.
> import Path.IO (listDir, getCurrentDir)
> import Streamly
>
> main = runStreaming $ serially $ getCurrentDir >>= readdir
> where readdir d = do
> (dirs, files) <- lift $ listDir d
> liftIO $ mapM_ putStrLn $ map show files
> foldMapWith (<|>) readdir dirs
.
See "Streamly.Tutorial" and "Streamly.Examples" (available only when built
with 'examples' build flag) for more details.
.
This library was originally inspired by the `transient`
package authored by Alberto G. Corona.
homepage: http://github.com/harendra-kumar/streamly
bug-reports: https://github.com/harendra-kumar/streamly/issues
license: BSD3
license-file: LICENSE
author: Harendra Kumar
maintainer: harendra.kumar@gmail.com
copyright: 2017 Harendra Kumar
category: Control, Concurrency, Streaming, Reactivity
stability: Experimental
build-type: Simple
cabal-version: >= 1.10
source-repository head
type: git
location: https://github.com/harendra-kumar/streamly
flag dev
description: Build development version
manual: True
default: False
flag extra-benchmarks
description: Include comparative benchmarks
manual: True
default: False
flag examples
description: Build examples
manual: True
default: False
flag examples-sdl
description: Include examples that use SDL dependency
manual: True
default: False
library
hs-source-dirs: src
other-modules: Streamly.Core
, Streamly.Streams
exposed-modules: Streamly.Prelude
, Streamly.Time
, Streamly.Tutorial
, Streamly
if flag(examples) || flag(examples-sdl)
exposed-modules: Streamly.Examples
, Streamly.Examples.SearchEngineQuery
, Streamly.Examples.ListDirRecursive
, Streamly.Examples.MergeSortedStreams
, Streamly.Examples.AcidRainGame
if flag(examples-sdl)
exposed-modules: Streamly.Examples.CirclingSquare
default-language: Haskell2010
ghc-options: -Wall
if flag(dev)
ghc-options: -Wmissed-specialisations
-Wall-missed-specialisations
-fno-ignore-asserts
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wunrecognised-warning-flags
-Widentities
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wnoncanonical-monad-instances
-Wnoncanonical-monadfail-instances
if flag(examples-sdl)
cpp-options: -DEXAMPLES_SDL
build-depends: base >= 4.8 && < 5
, atomic-primops >= 0.8 && < 0.9
, containers >= 0.5 && < 0.6
, exceptions >= 0.8 && < 0.9
, lifted-base >= 0.2 && < 0.3
, lockfree-queue >= 0.2.3 && < 0.3
, monad-control >= 1.0 && < 2
, mtl >= 2.2 && < 3
, stm >= 2.4.3 && < 2.5
, transformers >= 0.4 && < 0.6
, transformers-base >= 0.4 && < 0.5
if impl(ghc < 8.0)
build-depends:
semigroups >= 0.18 && < 0.19
if flag(examples) || flag(examples-sdl)
build-Depends:
http-conduit
, path-io
, random
if flag(examples-sdl)
build-Depends:
SDL >= 0.6.5 && < 0.7
test-suite test
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs: test
ghc-options: -O0 -Wall
if flag(dev)
ghc-options: -Wmissed-specialisations
-Wall-missed-specialisations
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wunrecognised-warning-flags
-Widentities
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wnoncanonical-monad-instances
-Wnoncanonical-monadfail-instances
build-depends:
streamly
, base >= 4.8 && < 5
, hspec >= 2.0 && < 3
, containers >= 0.5 && < 0.6
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
default-language: Haskell2010
benchmark bench
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs: benchmark
ghc-options: -O2 -Wall
if flag(dev)
ghc-options: -Wmissed-specialisations
-Wall-missed-specialisations
-fno-ignore-asserts
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wunrecognised-warning-flags
-Widentities
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wnoncanonical-monad-instances
-Wnoncanonical-monadfail-instances
build-depends:
streamly
, atomic-primops >= 0.8 && < 0.9
, base >= 4.8 && < 5
, criterion >= 1 && < 2
, mtl >= 2.2 && < 3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
if flag(extra-benchmarks)
cpp-options: -DEXTRA_BENCHMARKS
build-depends:
list-t >= 0.4 && < 2
, logict >= 0.6 && < 0.7
, machines >= 0.5 && < 0.7
, simple-conduit >= 0.6 && < 0.7
, transient >= 0.4 && < 0.6
default-language: Haskell2010
-------------------------------------------------------------------------------
-- Examples
-------------------------------------------------------------------------------
executable echo-loop
main-is: echo-loop.hs
hs-source-dirs: examples
if flag(examples)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
else
buildable: False
executable loops
main-is: loops.hs
hs-source-dirs: examples
if flag(examples)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
else
buildable: False
executable map-reduce
main-is: map-reduce.hs
hs-source-dirs: examples
if flag(examples)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
else
buildable: False
executable nested-loops
main-is: nested-loops.hs
hs-source-dirs: examples
if flag(examples)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
, random
else
buildable: False
executable parallel-loops
main-is: parallel-loops.hs
hs-source-dirs: examples
if flag(examples)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
, random
else
buildable: False