Programmation Fonctionnelle, TP3
Racine
Cours
Examen 2018
Correction examen 2018
TD
1. Variables et fonctions
2. Types paramétrés I
3. Types paramétrés II
4. Listes
5. Types algébriques I
6. Types algébriques II
7. Yojson, dictionnaires
8. Modules, foncteurs
9. Boucles fonctionnelles
10. Révisions
TP
1. Legos
2. Jeu du satellite
3. Fractale de Mandelbrot
4. Script et fichiers
5. Arbres binaires
6. Reingold-Tilford
7. OpenStreetMap
8. Le compte est bon
9. Paresse
10. Retour à Java
back to teaching
Version & licenses
Programmation Fonctionnelle, TP3 : stream_lzw.mli
Guyslain Naves
(** This module provides a (minimal) data structure for possibly infinite lists *)
(** the type of infinite lists *)
type
'a t
(** A function to check whether a list is empty *)
val
is_empty : 'a t -> bool
(** A function to returns the head and tail of an infinite list,
fails if the list is empty
*)
val
read : 'a t -> 'a * 'a t
(** the [map] function for infinite lists (similar to [List.map]) *)
val
map : ('a -> 'b) -> 'a t -> 'b t
(** the [flatten] function for infinite lists of finite lists (similat to [List.flatten]) *)
val
flatten : 'a list t -> 'a t
(** A constructor for infinite char lists, returning the content of a channel
(Recall that [in_channel] is defined in [Pervasive])
*)
val
of_in_channel : in_channel -> char t