git.iko.soy/purescript-stream
on master help sign in
docs(README): add basic readme
commit3773a5e997fd155a0ec02ce0af15ea82d4a2ca4c authorTylor Steinberger <tlsteinberger167@gmail.com> dateThu 16 Mar 2017, 14:13 (10 years ago) parent1369ee8
1 file changed+28
README.md+28
README.mdnew file+28
@@ -0,0 +1,28 @@
1+# Purescript Stream
2+
3+> An ultra-fast reactive stream library for purescript
4+
5+## Let me have it
6+```sh
7+bower install --save purescript-stream
8+```
9+
10+## Basic usage
11+```purescript
12+module Main where
13+
14+import Prelude
15+import Control.Monad.Eff (Eff)
16+import Control.Monad.Eff.Console (CONSOLE, logShow, log)
17+import Control.Stream (STREAM, periodic, constant, scan, tapEvent, tapEnd, drain)
18+import Data.Unit (Unit)
19+
20+main :: Eff (stream :: STREAM, console :: CONSOLE) Unit
21+main = do
22+ periodic 1000.0 -- Stream Unit
23+ # constant 1 -- Stream Int
24+ # scan (+) 0 -- Stream Int
25+ # tapEvent logShow -- Perform side-effects on events
26+ # tapEnd (log "done") -- Perform a side-effect on stream completion
27+ # drain -- activate your stream
28+```