Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
DA.Record
Exports the record machinery necessary to allow one to annotate code that is polymorphic in the underlying record type.Module Snapshot
Lifecycle
Stable.
Notices
Status:
active
Introduced in: 3.4.9
Removed in: -
Warnings: 0
Deprecations: 0
Deprecated since: -Data Types
type HasField = (GetField x r a, SetField x r a)
HasField is a class synonym for GetField and SetField, which
respectively give you getter and setter functions for each record field
automatically.
In the vast majority of use-cases, plain Record syntax should be
preferred:
GetField x r a and SetField x r a are typeclasses taking three parameters. The first
parameter x is the field name, the second parameter r is the record type,
and the last parameter a is the type of the field in this record. For
example, if we define a type:
getField method of class GetField:
f @t ) to specify the
field name.
Likewise, if we want to set the value in the field, we can use the setField method of class SetField:
Typeclasses
class GetField x r a
GetField x r a provides the getter part of HasField
Methods:
getField : r -> a
instance GetField _1 (a, b) ainstance GetField _1 (a, b, c) ainstance GetField _1 (a, b, c, d) ainstance GetField _1 (a, b, c, d, e) ainstance GetField _2 (a, b) binstance GetField _2 (a, b, c) binstance GetField _2 (a, b, c, d) binstance GetField _2 (a, b, c, d, e) binstance GetField _3 (a, b, c) cinstance GetField _3 (a, b, c, d) cinstance GetField _3 (a, b, c, d, e) cinstance GetField _4 (a, b, c, d) dinstance GetField _4 (a, b, c, d, e) dinstance GetField _5 (a, b, c, d, e) einstance GetField appEndo (Endo a) (a -> a)instance GetField category FailureStatus FailureCategoryinstance GetField errorId FailureStatus Textinstance GetField getAll All Boolinstance GetField getAny Any Boolinstance GetField getAnyView AnyView Anyinstance GetField getAnyViewInterfaceTypeRep AnyView InterfaceTypeRepinstance GetField hd (NonEmpty a) ainstance GetField map (Set k) (Map k ())instance GetField message FailureStatus Textinstance GetField message ArithmeticError Textinstance GetField message AssertionFailed Textinstance GetField message GeneralError Textinstance GetField message PreconditionFailed Textinstance GetField meta FailureStatus (TextMap Text)instance GetField runState (State s a) (s -> (a, s))instance GetField srcLocEndCol SrcLoc Intinstance GetField srcLocEndLine SrcLoc Intinstance GetField srcLocFile SrcLoc Textinstance GetField srcLocModule SrcLoc Textinstance GetField srcLocPackage SrcLoc Textinstance GetField srcLocStartCol SrcLoc Intinstance GetField srcLocStartLine SrcLoc Intinstance GetField tl (NonEmpty a) [a]
class SetField x r a
SetField x r a provides the setter part of HasField
Methods:
setField : a -> r -> r
instance SetField _1 (a, b) ainstance SetField _1 (a, b, c) ainstance SetField _1 (a, b, c, d) ainstance SetField _1 (a, b, c, d, e) ainstance SetField _2 (a, b) binstance SetField _2 (a, b, c) binstance SetField _2 (a, b, c, d) binstance SetField _2 (a, b, c, d, e) binstance SetField _3 (a, b, c) cinstance SetField _3 (a, b, c, d) cinstance SetField _3 (a, b, c, d, e) cinstance SetField _4 (a, b, c, d) dinstance SetField _4 (a, b, c, d, e) dinstance SetField _5 (a, b, c, d, e) einstance SetField appEndo (Endo a) (a -> a)instance SetField category FailureStatus FailureCategoryinstance SetField errorId FailureStatus Textinstance SetField getAll All Boolinstance SetField getAny Any Boolinstance SetField getAnyView AnyView Anyinstance SetField getAnyViewInterfaceTypeRep AnyView InterfaceTypeRepinstance SetField hd (NonEmpty a) ainstance SetField map (Set k) (Map k ())instance SetField message FailureStatus Textinstance SetField message ArithmeticError Textinstance SetField message AssertionFailed Textinstance SetField message GeneralError Textinstance SetField message PreconditionFailed Textinstance SetField meta FailureStatus (TextMap Text)instance SetField runState (State s a) (s -> (a, s))instance SetField srcLocEndCol SrcLoc Intinstance SetField srcLocEndLine SrcLoc Intinstance SetField srcLocFile SrcLoc Textinstance SetField srcLocModule SrcLoc Textinstance SetField srcLocPackage SrcLoc Textinstance SetField srcLocStartCol SrcLoc Intinstance SetField srcLocStartLine SrcLoc Intinstance SetField tl (NonEmpty a) [a]