LF.Object
LF kinds, types and terms blurred together.
type t =
| Raw_identifier of {
location : Beluga_syntax.Syncom.Location.t;
identifier : Beluga_syntax.Syncom.Identifier.t;
prefixed : Stdlib.Bool.t;
}
Raw_identifier { identifier = "x"; prefixed = false; _ }
is the variable or constant "x"
.Raw_identifier { identifier = "x"; prefixed = true; _ }
is the prefixed variable or constant "(x)"
.A prefixed constant may appear as an argument, or as applicand in prefix notation irrespective of its pre-defined fixity and associativity.
*)| Raw_qualified_identifier of {
location : Beluga_syntax.Syncom.Location.t;
identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
prefixed : Stdlib.Bool.t;
}
Raw_qualified_identifier { identifier = "M.x"; prefixed = false; _ }
is the constant "M.x"
.Raw_qualified_identifier { identifier = "M.x"; prefixed = true; _ }
is the prefixed constant "(M.x)"
.Since identifiers are ambiguous with qualified identifiers in the parser, the following may be assumed during disambiguation: List.length (Qualified_identifier.namespaces identifier) >= 1
.
A prefixed constant may appear as an argument, or as applicand in prefix notation irrespective of its pre-defined fixity and associativity.
*)| Raw_type of {
location : Beluga_syntax.Syncom.Location.t;
}
| Raw_hole of {
location : Beluga_syntax.Syncom.Location.t;
}
| Raw_pi of {
location : Beluga_syntax.Syncom.Location.t;
parameter_identifier : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
parameter_sort : t Support.Option.t;
plicity : Beluga_syntax.Syncom.Plicity.t;
body : t;
}
Raw_pi { parameter_identifier = Option.Some "x"; parameter_sort = Option.Some t; body; _ }
is the Pi kind or type { x : t } body
.
It is a syntax error to omit the parameter sort. Implicit Pis currently do not have a corresponding syntax, but it may be added in the future.
*)| Raw_lambda of {
location : Beluga_syntax.Syncom.Location.t;
parameter_identifier : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
parameter_sort : t Support.Option.t;
body : t;
}
| Raw_arrow of {
location : Beluga_syntax.Syncom.Location.t;
domain : t;
range : t;
orientation : [ `Forward | `Backward ];
}
| Raw_annotated of {
location : Beluga_syntax.Syncom.Location.t;
object_ : t;
sort : t;
}
| Raw_application of {
location : Beluga_syntax.Syncom.Location.t;
objects : t Support.List2.t;
}
Raw_application { objects; _ }
is the juxtaposition of objects
delimited by whitespaces. objects
may contain prefix, infix or postfix operators, along with operands. These are rewritten during the disambiguation to the external syntax.