Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/core.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

type ('a, 'b) conv = {
to_ : 'a -> 'b ;
from_ : 'b -> 'a ;
}

module Seq = struct
include Seq

let of_list l =
let rec aux l () = match l with
| [] -> Seq.Nil
| x :: tail -> Seq.Cons (x, aux tail)
in
aux l
let to_rev_list gen =
fold_left (fun acc x -> x :: acc) [] gen
let to_list gen = List.rev (to_rev_list gen)
end
12 changes: 11 additions & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,15 @@
(public_name tyre)
(synopsis
"Tyre is a set of combinators to build type-safe regular expressions")
(libraries re result seq)
(libraries re tyrefun)
(modules Tyre Impl)
(ocamlopt_flags :standard -O3))

(library
(name tyrefun)
(public_name tyre.fun)
(libraries result seq)
(modules_without_implementation sigs)
(modules Tyrefun Core Functor Sigs)
(ocamlopt_flags :standard -O3)
)
Loading