Page
Library
Module
Module type
Parameter
Class
Class type
Source
Bibtex.Fields
SourcePredefined bibtex fields and helper functions.
Talaria-bibtex exposes its own orec
namespace
include Orec.Namespace.S
The type of record within the namespace
The type of a field getter or updater
type 'info get = (('a, 'mut) Orec.Type_data.getter * 'res) field_action constraint 'info = < x : 'a ; mut : 'mut ; ret : 'res >
Aliases for the field types
Create a new open record from a list of field updater : create [ field1 ^= value1; field2 ^= value2; ... ]
Only const updater make sense in this context, since there is no fields present.
Creation of a new fields. Note that the type 'ty is weakly polymorphic once the field created. However, in this specific use case, it seems reasonable to annotate the field type by using one of the field type aliases.
Constant field updater: record.%{ field ^= v }
sets the value of field
to v
and is equivalent to record.%{ put field v }
Field map: record.%{field |= f }
or record.%{ fmap field f }
are equivalent to record.%{ field ^= f record.%{field} }
if the field exists, and do nothing otherwise
Field combinator orec.%{ x & y }
is orec.%{x}.%{y}
val (&) :
(Orec.Type_data.any, t) update ->
(Orec.Type_data.any, t) update ->
(Orec.Type_data.any, t) update
val and_then :
(Orec.Type_data.any, t) update ->
(Orec.Type_data.any, t) update ->
(Orec.Type_data.any, t) update
Copy a mutable field
Delete a field, if the field does not exist, do nothing
Operator version of get+update and set
(.%{} )
operator:
record.%{field}
returns the value of the fieldrecord.%{field ^= value}
returns a functional update of record record.%{field |= f}
is equivalent to record.{ field ^= f record.{field} }
record.%{delete field}
returns an updated version of record without this fieldval transmute :
(< x : 'a ; mut : 'm.. > as 'x) get ->
('a, 'b) bijection ->
< x : 'b ; mut : 'm ; ret : 'b option > get
Use the type equality implied by the bijection 'a⟺'b
to create a new 'b
field getter from an 'a
field getter. The new field getter uses option access
val (@:) :
(< x : 'a ; mut : 'm.. > as 'x) get ->
('a, 'b) bijection ->
< x : 'b ; mut : 'm ; ret : 'b option > get
Operator version of transmute
A bibtex field consists of an orec
field, a name and a translation between the raw text of the field towards a typed field
The exception Unknown_attribute
is raised whenever a type dkey fails to parse its contents to its underlying type.
Create a string view from a named_field
Field creation helper
The default typed keys when parsing bibtex file
Raw database and entries