| 1234567891011121314151617 |
- type suite = char list;;
- type code = bool list;;
- type cle = (char * code) list;;
- let coder (s:suite) (c:cle)=
- let rec code_of_char t cl = match cl with
- | [] -> failwith "Erreur dans coder"
- | (x,l)::r -> if x=t then l
- else code_of_char t r
- and coder_aux ss = match ss with
- | [] -> []
- | t::q -> (code_of_char t c)@(coder_aux q)
- in coder_aux s ;;
|