Skip to content

Remove >> syntax from the PPX #495

@Sventimir

Description

@Sventimir

I have recently spent half an afternoon wondering, why an operator >> I defined in a module does not work properly in my code, only to find out that the reason was lwt.ppx used in the project. Why is >> defined as a syntax extension, when it's just a simple function? It could (and certainly should!) be defined in Lwt.Infix as simple as this:

let (>>) a b = a >>= fun _ -> b

Having it as a syntax extension instead denies users the possibility to define their own >> operator, which is idiomatic for any monad, not only Lwt. Besides it's just confusing when somebody (like myself) does not know about it. I would gladly see it changed. In fact I could probably do it myself unless there is a good reason not to, which is why I post here instead of submitting a pull-request directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions