Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signature STREAM =
- sig
- type 'a stream (* abstract *)
- datatype 'a front = Empty | Cons of 'a * 'a stream
- (* Lazy stream construction and exposure *)
- val delay : (unit -> 'a front) -> 'a stream
- val expose : 'a stream -> 'a front
- (* Eager stream construction *)
- val empty : 'a stream
- val cons : 'a * 'a stream -> 'a stream
- exception EmptyStream
- val null : 'a stream -> bool
- val hd : 'a stream -> 'a
- val tl : 'a stream -> 'a stream
- val map : ('a -> 'b) -> 'a stream -> 'b stream
- val filter : ('a -> bool) -> 'a stream -> 'a stream
- val exists : ('a -> bool) -> 'a stream -> bool
- val zip : 'a stream * 'b stream -> ('a * 'b) stream
- val take : 'a stream * int -> 'a list
- val drop : 'a stream * int -> 'a stream
- val tabulate : (int -> 'a) -> 'a stream
- val append : 'a stream * 'a stream -> 'a stream
- end
Advertisement
Add Comment
Please, Sign In to add comment