Partial match: Style advice

Ideally:

type sign = Negative | Nonnegative

let g x = if x < 0 then Negative else Nonnegative

let f4 x =  
   ...
   match s with
   | Negative -> "(negative)"
   | Nonnegative -> "(positive)"

if that’s really not an option for you then

let f5 x =
    ...
    match s with
    | -1 -> "(negative)"
    | 1 -> "(positive)"
    | s -> failwith ("f5: g returned non-sign result: " ^ Int.to_string s)