Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Apr 22, 2016
0 parents commit 8d9093b
Show file tree
Hide file tree
Showing 12 changed files with 757 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_build
*.native
*.docdir
*.install
1 change: 1 addition & 0 deletions .header
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(* This file is free software. See file "license" for more details. *)
5 changes: 5 additions & 0 deletions .merlin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
S src
B _build/src
PKG lwt
PKG result
FLG -w +a-4
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2016, Simon Cruanes
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. Redistributions in binary
form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

OPTS= -classic-display -use-ocamlfind
TARGETS= lwt_pipe.cma lwt_pipe.cmxa lwt_pipe.cmxs lwt_pipe.a

build:
ocamlbuild $(OPTS) $(addprefix src/, $(TARGETS))

clean:
ocamlbuild -clean

install: build
ocamfind install lwt_pipe src/META $(addprefix _build/src/, $(TARGETS)) _build/src/*.cmi
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Lwt Pipe

An alternative to `Lwt_stream` with interfaces for producers and consumers
and a bounded internal buffer.

## Build

opam install lwt_pipe

or:

opam pin add -k git lwt-pipe https://github.com/c-cube/lwt_pipe.git
opam install lwt_pipe

## Use

```ocaml
# #require "lwt";;
# #require "lwt_pipe";;
# open Lwt.Infix;;
# let l = [1;2;3;4];;
# Lwt_pipe.of_list l
|> Lwt_pipe.Reader.map ~f:(fun x->x+1)
|> Lwt_pipe.to_list;;
```

## License

permissive free software (BSD-2)
3 changes: 3 additions & 0 deletions _tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<src>: include
<src/*>: package(lwt), package(result)
true: safe_string, short_paths, warn(+a-4)
26 changes: 26 additions & 0 deletions opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
opam-version: "1.2"
name: "lwt_pipe"
version: "dev"
author: "Simon Cruanes"
maintainer: "[email protected]"
build: [
[make "build"]
]
install: [
[make "install"]
]
remove: [
["ocamlfind" "remove" "lwt_pipe"]
]
build-doc: [ make "doc" ]
depends: [
"ocamlfind" {build}
"ocamlbuild" {build}
"result"
"lwt"
]
tags: [ "lwt" "pipe" "stream" "blocking" ]
homepage: "https://github.com/c-cube/lwt_pipe/"
dev-repo: "https://github.com/c-cube/lwt_pipe.git"
bug-reports: "https://github.com/c-cube/lwt_pipe/issues/"

Loading

0 comments on commit 8d9093b

Please sign in to comment.