OCamlPro / ocp-indent

Indentation tool for OCaml, to be used from editors like Emacs and Vim.
http://www.typerex.org/ocp-indent.html
Other
201 stars 63 forks source link

The (and+) operator seems wrongly indented #292

Closed mlasson closed 5 years ago

mlasson commented 5 years ago

On current master, I have after running:

$ _build/install/default/bin/ocp-indent ~/test.ml

I obtain

let (and+) x y =
           match x,y with
           | Some x, Some y -> Some (x, y)
           | _ -> None

while I expected

let (and+) x y =
  match x,y with
  | Some x, Some y -> Some (x, y)
  | _ -> None

similarly signatures are broken:

module Infix : sig
  val (and+) : ('a, 'error) result -> ('b, 'error) result -> ('a * 'b, 'error) result
val (let+) : ('a, 'error) result -> ('a -> 'b) -> ('b, 'error) result
end

instead of :

module Infix : sig
  val (and+) : ('a, 'error) result -> ('b, 'error) result -> ('a * 'b, 'error) result
  val (let+) : ('a, 'error) result -> ('a -> 'b) -> ('b, 'error) result
end
mlasson commented 5 years ago

Thanks !