package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

merlin-5.8.1-505.tbz
sha256=b8fb32bc0fc092af2fd6bdc831cb966057f2e3fd7b99a172b705e96ba8082583
sha512=01ca96f8167d062ba24036e43f650ff958fb157d44867bd52eb7999b7d19bf9fc97cdcd46c04b6979f0e1149d5041047723eed5913b03c4404d7acb116183bee

doc/merlin-lib.kernel/Merlin_kernel/Mbrowse/Tie_breaker/index.html

Module Mbrowse.Tie_breakerSource

Some nodes in the typedtree may share the same, non-ghost, location, while being different. One example of this is let-punning:

let+ x in

Both x as an expression and as a pattern share the exact same location.

This module is about tie-breaking those cases to select the node that we want.

Sourcetype tie_break =
  1. | Prefer_first
  2. | Prefer_second
Sourcetype t = node -> node -> tie_break option

If f : t, then f node1 node2 answers:

  • Some Prefer_first to select node1
  • Some Prefer_second to select node2
  • None to let the default disambiguation mechanism break the tie.
Sourceval prefer_expression : t

Tie-break by preferring expression over other nodes