- List.map
- (function
- None -> None
- | Some (n, C.Decl t)-> Some (n, C.Decl (eta_fix conjectures t))
- | Some (n, C.Def (t,None)) ->
- Some (n, C.Def ((eta_fix conjectures t),None))
- | Some (_,C.Def (_,Some _)) -> assert false
- ) canonical_context
+ List.fold_right
+ (fun d canonical_context' ->
+ let d' =
+ match d with
+ None -> None
+ | Some (n, C.Decl t)->
+ Some (n, C.Decl (eta_fix conjectures canonical_context' t))
+ | Some (n, C.Def (t,None)) ->
+ Some (n,
+ C.Def ((eta_fix conjectures canonical_context' t),None))
+ | Some (_,C.Def (_,Some _)) -> assert false
+ in
+ d::canonical_context'
+ ) [] canonical_context