let wrap f x =
    try Good (f x) with e -> Bad e