Idris2Doc : Records

Records

(source)

Definitions

RecordSpec : Type->Type
  Specification for a record, consisting of a list of key value pairs, where the value is the specification for that field.

Visibility: public export
dataRecordField : String->Type->Type
  A field (label value pair) in the record, with the given label and
type. The label is erased at the value level, but included to
make it easy to see which field is used in the code.

Totality: total
Visibility: public export
Constructor: 
(:->) : (0s : String) ->t->RecordFieldst
dataField : String->Type->Type
  A field definition for a given label.

Totality: total
Visibility: public export
Constructor: 
(:->:) : (s : String) ->t->Fieldst
FieldSpec : Fieldst->t
  Get the specification for a single field.

Visibility: public export
FieldToType : Type->Type
  The actual type of a field in the record.

Visibility: public export
dataRecord : RecordSpeck->FieldToTypek->Type
  A strongly specified record.  The type contains the specification,
and a function mapping that specification for each field to a
concrete type.

Totality: total
Visibility: public export
Constructors:
Nil : {0f : FieldToTypek} ->Record [] (\{s:894}=>f)
(::) : {0f : FieldToTypek} ->RecordFieldlbl (f (lbl:->:t)) ->Recordxs (\{s:920}=>f) ->Record ((lbl, t) ::xs) (\{s:928}=>f)
SimpleRecord : RecordSpecType->Type
  Simple record with types as specification

Visibility: public export
AllConstraints : (a->Type) ->Lista->Type
  Constraint that holds for all values in a list.

Visibility: public export
dataHasField : String->k->RecordSpeck->Type
  proof that the spec has some label with the given spec

Totality: total
Visibility: public export
Constructors:
FirstField : HasFieldst ((s, t) ::{_:1009})
NextField : {auto0_ : t==s=False} ->HasFieldsvxs->HasFieldsv ((t, w) ::xs)

Hint: 
Uninhabited (HasFieldst [])
HasField' : RecordSpeck-> (String, k) ->Type
Visibility: public export
HasFields : RecordSpeck->RecordSpeck->Type
  Proof that a spec is a subset of another spec.

Visibility: public export
dataLabelOf : RecordSpeck->Type
  A label of a spec.  Contains a hidden (auto) proof that the label
is actually in the RecordSpec, and a hidden reference to the field Spec.

Totality: total
Visibility: public export
Constructor: 
MkLabel : (lbl : String) ->HasFieldlbltspec=>LabelOfspec
labelString : LabelOfspec->String
  Extract the string of the label

Visibility: export
labelSpec : LabelOfspec->k
  Extract the spec from the label

Visibility: export
dataIsNothing : Maybea->Type
Totality: total
Visibility: public export
Constructor: 
ItIsNothing : IsNothingNothing
dataHasOptionalField : String->k->RecordSpeck->Type
  proof that an optional field with the given spec exists.  The spec
must be either present with the right type, or be absent. This is
written in terms of HasField, so it is isomorphic to Maybe
Natural, which has an efficient runtime representation.

Totality: total
Visibility: public export
Constructors:
NoSuchField : IsNothing (lookupsspecs) =>HasOptionalFieldstspecs
FieldExists : HasFieldstspecs=>HasOptionalFieldstspecs
HasOptionalField' : RecordSpeck-> (String, k) ->Type
Visibility: public export
HasOptionalFields : RecordSpeck->RecordSpeck->Type
Visibility: public export
remField : RecordSpeck-> (String, k) ->RecordSpeck
Visibility: export
remFields : RecordSpeck->RecordSpeck->RecordSpeck
Visibility: export
dataNubFields : RecordSpeck->RecordSpeck->RecordSpeck->Type
Totality: total
Visibility: public export
Constructor: 
MkNubFields : NubFieldsspecfields (remFieldsspecfields)
dataWithRecordFields : RecordSpeck->RecordSpeck->RecordSpeck->RecordSpeck->Type
  Proof that a record contains some mandatory fields, some optional
fields, and some remaining fields.

Totality: total
Visibility: public export
Constructor: 
MkWithRecordFields : HasFieldsspecmandatory=>NubFieldsspec (optional++mandatory) other=>WithRecordFieldsspecmandatoryoptionalother
hasFieldToIndex : HasFieldstr->Integer
  Create an integer index of the field from the HasField proof.

Visibility: export
get : (0lbl : String) -> {0f : FieldToTypek} ->HasFieldlbltr=>Recordr (\{s:1502}=>f) ->f (lbl:->:t)
  Get a field value by label

Visibility: public export
SpecGet : (0lbl : String) -> (r : RecordSpeck) ->HasFieldlbltr=>k
  Get a field specification from the RecordSpec by label

Visibility: public export
(!!) : {0f : FieldToTypek} ->Recordr (\{s:1640}=>f) -> (0lbl : String) ->HasFieldlbltr=>f (lbl:->:t)
  Operator version of get with arguments flipped.

Visibility: export
Fixity Declaration: infixr operator, level 10
getMaybe : {0f : FieldToTypek} -> (0s : String) ->HasOptionalFieldstr=>Recordr (\{s:1698}=>f) ->Maybe (f (s:->:t))
  Get an optional field from a spec, as Maybe value

Visibility: public export
getOpt : {0f : FieldToTypek} -> (0s : String) ->HasOptionalFieldstr=> Lazy (f (s:->:t)) ->Recordr (\{s:1783}=>f) ->f (s:->:t)
  Get an optional field, return the given default if it is not found.

Visibility: public export
set : {0f : FieldToTypek} ->RecordFieldlbl (f (lbl:->:t)) ->HasFieldlbltr=>Recordr (\{s:1839}=>f) ->Recordr (\{s:1846}=>f)
  Set a field in a record.

Visibility: export
mapRecord : {0f : FieldToTypek} -> {0g : FieldToTypek} -> (f (lbl:->:spec) ->g (lbl:->:spec)) ->Recordspecs (\{s:1972}=>f) ->Recordspecs (\{s:1979}=>g)
  Map a function over all fields of a record.

Visibility: public export
sequenceRecord : Applicativem=> {0f : FieldToTypek} ->Recordspec (\{s:2068}=>m.f) ->m (Recordspec (\{s:2080}=>f))
  Run all the effects for each field.

Visibility: public export
traverseRecord : Applicativem=> {0f : FieldToTypek} -> {0g : FieldToTypek} -> (f (lbl:->:spec) ->m (g (lbl:->:spec))) ->Recordspecs (\{s:2204}=>f) ->m (Recordspecs (\{s:2211}=>g))
  Apply an effectful function over all fields of the record.

Visibility: public export
aseq : Applicativem=>Recordspec (\{s:2334}=>m.FieldSpec) ->m (SimpleRecordspec)
  convenient specialization of sequenceRecord, to bind applicative
values. Useful as replacement of applicative do in haskell.

Visibility: public export
mapRecordSpec : {0f : FieldToTypek} -> (spec : RecordSpeck) -> ((label : String) -> (spec : k) ->f (label:->:spec)) ->Recordspec (\{s:2384}=>f)
  Create a record by applying a function over each field in the RecordSpec.

Visibility: public export
traverseRecordSpec : Applicativem=> {0f : FieldToTypek} -> (spec : RecordSpeck) -> ((label : String) -> (spec : k) ->m (f (label:->:spec))) ->m (Recordspec (\{s:2453}=>f))
  Create a record by applying an effectful function over each field in the RecordSpec.

Visibility: public export
zipWithRecord : {0f : FieldToTypek} -> {0g : FieldToTypek} -> {0h : FieldToTypek} -> (f (s:->:a) ->g (s:->:a) ->h (s:->:a)) ->Recordspec (\{s:2575}=>f) ->Recordspec (\{s:2584}=>g) ->Recordspec (\{s:2591}=>h)
  Zip two records for each field in the record.

Visibility: public export
dataHkdList : (k->Type) ->Listk->Type
  Higher kinded heterogenous list

Totality: total
Visibility: public export
Constructors:
Nil : HkdListf []
(::) : fa->HkdListfb->HkdListf (a::b)
mapHkd : (fa->ga) ->HkdListfs->HkdListgs
  map a Hkd List

Visibility: export
zipWithManyRecord : {g : FieldToTypek} -> (HkdList (\{arg:0}=>{arg:0} (s:->:a)) fs->g (s:->:a)) ->HkdList (Recordspec) fs->Recordspec (\{s:2997}=>g)
  Zip a (heterogenous) list of records, by zipping each row over a
function. The function takes a list of all the values in that row
for each of the records.

Visibility: export
foldMapRecord : Monoidm=> {f : FieldToTypek} -> (f (s:->:a) ->m) ->Recordspec (\{s:3165}=>f) ->m
  Maps each field to a value and combine them.

Visibility: export
foldrRecord : {f : FieldToTypek} -> (f (s:->:a) ->acc->acc) ->acc->Recordspec (\{s:3268}=>f) ->acc
  Successively combine the fields using the provided function,
starting with the element that is in the final position i.e. the
right-most position.

Visibility: export
foldlRecord : {f : FieldToTypek} -> (acc->f (s:->:a) ->acc) ->acc->Recordspec (\{s:3361}=>f) ->acc
  Successively combine the fields using the provided function,
starting with the element that is in the first position i.e. the
left-most position.

Visibility: export
recordLabels : Recordspec (\{s:3427}=>constString)
  create a record with all the labels of the spec.

Visibility: export
EntryDict : ((String, k) ->Type) ->FieldToTypek
  Type of the interface implementation for a given field.

Visibility: public export
recordDicts : (0c : ((String, k) ->Type)) -> (spec : RecordSpeck) ->AllConstraintscspec=>Recordspec (\{s:3498}=>EntryDictc)
  Create a record with the interface implementations for each field of the spec.

Visibility: export
recordSpecs : (l : RecordSpeck) ->Recordl (\{s:3550}=>constk)
  Create a record with the specs for each field from the record spec.

Visibility: export
concatRecords : {f : FieldToTypek} ->Recordspec1 (\{s:3594}=>f) ->Recordspec2 (\{s:3603}=>f) ->Record (spec1++spec2) (\{s:3611}=>f)
  Concatenate two records

Visibility: export
RecordSubset : List (LabelOfspec) ->RecordSpeck
  A subset of a RecordSpec, given a list of labels.

Visibility: public export
recordSubset : {f : FieldToTypek} -> (labels : List (LabelOfspec)) ->Recordspec (\{s:3709}=>f) ->Record (RecordSubsetlabels) (\{s:3718}=>f)
  Create a subset of a record, given a list of labels.

Visibility: export