let rec map f a =
  match a with
    | App(Coproduct(op), [x]) ->
        let x' = map f x in
          if x == x' then a else sigma op [x']
    | _ -> 
        f a