Module Nameops.Name
include module type of sig ... end
type t
= Names.Name.t
=
|
Anonymous
|
Name of Names.Id.t
val fold_left : ('a -> Names.Id.t -> 'a) -> 'a -> Names.Name.t -> 'a
fold_left f na a
isf id a
ifna
isName id
, anda
otherwise.
val fold_right : (Names.Id.t -> 'a -> 'a) -> Names.Name.t -> 'a -> 'a
fold_right f a na
isf a id
ifna
isName id
, anda
otherwise.
val iter : (Names.Id.t -> unit) -> Names.Name.t -> unit
iter f na
doesf id
ifna
equalsName id
, nothing otherwise.
val map : (Names.Id.t -> Names.Id.t) -> Names.Name.t -> t
map f na
isAnonymous
ifna
isAnonymous
andName (f id)
ifna
isName id
.
val fold_left_map : ('a -> Names.Id.t -> 'a * Names.Id.t) -> 'a -> Names.Name.t -> 'a * Names.Name.t
fold_left_map f a na
isa',Name id'
whenna
isName id
andf a id
is(a',id')
. It isa,Anonymous
otherwise.
val fold_right_map : (Names.Id.t -> 'a -> Names.Id.t * 'a) -> Names.Name.t -> 'a -> Names.Name.t * 'a
fold_right_map f na a
isName id',a'
whenna
isName id
andf id a
is(id',a')
. It isAnonymous,a
otherwise.
val get_id : Names.Name.t -> Names.Id.t
get_id
associatesid
toName id
.- raises IsAnonymous
otherwise.
val pick : Names.Name.t -> Names.Name.t -> Names.Name.t
pick na na'
returnsAnonymous
if both names areAnonymous
. Pick one ofna
orna'
otherwise.
val pick_annot : Names.Name.t Context.binder_annot -> Names.Name.t Context.binder_annot -> Names.Name.t Context.binder_annot
val cons : Names.Name.t -> Names.Id.t list -> Names.Id.t list
cons na l
returnsid::l
ifna
isName id
andl
otherwise.
val to_option : Names.Name.t -> Names.Id.t option
to_option Anonymous
isNone
andto_option (Name id)
isSome id