mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
include Seq in CCSeq for ocaml >= 4.07
This commit is contained in:
parent
a5f9f2b95d
commit
47ff9935dc
2 changed files with 16 additions and 0 deletions
|
|
@ -6,9 +6,17 @@ type 'a equal = 'a -> 'a -> bool
|
||||||
type 'a ord = 'a -> 'a -> int
|
type 'a ord = 'a -> 'a -> int
|
||||||
type 'a printer = Format.formatter -> 'a -> unit
|
type 'a printer = Format.formatter -> 'a -> unit
|
||||||
|
|
||||||
|
[@@@ifge 4.07]
|
||||||
|
|
||||||
|
include Seq
|
||||||
|
|
||||||
|
[@@@else_]
|
||||||
|
|
||||||
type +'a t = unit -> 'a node
|
type +'a t = unit -> 'a node
|
||||||
and +'a node = 'a Seq.node = Nil | Cons of 'a * 'a t
|
and +'a node = 'a Seq.node = Nil | Cons of 'a * 'a t
|
||||||
|
|
||||||
|
[@@@endif]
|
||||||
|
|
||||||
let nil () = Nil
|
let nil () = Nil
|
||||||
let cons a b () = Cons (a, b)
|
let cons a b () = Cons (a, b)
|
||||||
let empty = nil
|
let empty = nil
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,17 @@ type 'a printer = Format.formatter -> 'a -> unit
|
||||||
|
|
||||||
(** {2 Basics} *)
|
(** {2 Basics} *)
|
||||||
|
|
||||||
|
[@@@ifge 4.07]
|
||||||
|
|
||||||
|
include module type of Seq
|
||||||
|
|
||||||
|
[@@@else_]
|
||||||
|
|
||||||
type +'a t = unit -> 'a node
|
type +'a t = unit -> 'a node
|
||||||
and +'a node = 'a Seq.node = Nil | Cons of 'a * 'a t
|
and +'a node = 'a Seq.node = Nil | Cons of 'a * 'a t
|
||||||
|
|
||||||
|
[@@@endif]
|
||||||
|
|
||||||
val nil : 'a t
|
val nil : 'a t
|
||||||
val empty : 'a t
|
val empty : 'a t
|
||||||
val cons : 'a -> 'a t -> 'a t
|
val cons : 'a -> 'a t -> 'a t
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue