| _ -> raise CicPpInternalError
)
in
+ let connames_and_patterns =
+ let rec combine =
+ function
+ [],[] -> []
+ | [],l -> List.map (fun x -> "???",Some x) l
+ | l,[] -> List.map (fun x -> x,None) l
+ | x::tlx,y::tly -> (x,Some y)::(combine (tlx,tly))
+ in
+ combine (connames,patterns)
+ in
"\n<" ^ pp ty l ^ ">Cases " ^ pp te l ^ " of " ^
- List.fold_right (fun (x,y) i -> "\n " ^ x ^ " => " ^ pp y l ^ i)
- (List.combine connames patterns) "" ^
+ List.fold_right
+ (fun (x,y) i -> "\n " ^ x ^ " => " ^
+ (match y with None -> "" | Some y -> pp y l) ^ i)
+ connames_and_patterns "" ^
"\nend"
| C.Fix (no, funs) ->
let snames = List.map (fun (name,_,_,_) -> name) funs in