Programmation Fonctionnelle, TP3

Version & licenses
Creative Commons License

Programmation Fonctionnelle, TP3 : stream_lzw.mli

Guyslain Naves
  1. (** This module provides a (minimal) data structure for possibly infinite lists *)

  2. (** the type of infinite lists *)
  3. type 'a t

  4. (** A function to check whether a list is empty *)
  5. val is_empty : 'a t -> bool

  6. (** A function to returns the head and tail of an infinite list,
  7. fails if the list is empty
  8. *)
  9. val read : 'a t -> 'a * 'a t

  10. (** the [map] function for infinite lists (similar to [List.map]) *)
  11. val map : ('a -> 'b) -> 'a t -> 'b t

  12. (** the [flatten] function for infinite lists of finite lists (similat to [List.flatten]) *)
  13. val flatten : 'a list t -> 'a t

  14. (** A constructor for infinite char lists, returning the content of a channel
  15. (Recall that [in_channel] is defined in [Pervasive])
  16. *)
  17. val of_in_channel : in_channel -> char t