úÎ843Û<      !"#$%&'()*+,-./0123456789:;<The access functions we propose, look very similar to those Lneeded for List.mapAccumL (but parameter order is swapped) and State monad. 3They get the new value of the field and the record Mand return the old value of the field and the record with the updated field. <=Access the record itself (Access a (non-existing) element of type () Set the value of a field.  as infix operator. This lets us write %first ^= 2+3 $ second ^= 5+7 $ record. This is a general function, Obut it is especially useful for setting many values of different type at once. Get the value of a field.  as infix operator. This lets us write record^.field^.subfield.  This imitates Modula II syntax. /Transform the value of a field by a function.   as infix operator. This lets us write field^:subfield^:(2*) $ record, record$%field^:subfield^:(2*) or "record$%field^:subfield^:(const 1). Flipped version of '($)'. Accessor composition: 5Combine an accessor with an accessor to a sub-field. Speak "stack". *Accessor composition the other direction.  (<.) = flip (.>)      2Modify a record element and return its old value. 2Modify a record element and return its new value. Infix variant of . Infix variant of .    *Treats a finite map like an infinite map, >where all undefined elements are replaced by a default value. *Treats a finite map like an infinite map, !where all undefined elements are > and defined elements are ?. @&Access to the first value of a pair. 'Access to the second value of a pair. !(Access to the first value of a triple. ")Access to the second value of a triple. #(Access to the third value of a triple.  !"# !"# !"#$%&'()*+,-./01$%&'()*+,-./01/-.+,)*'($%&01$%&%&'(()**+,,-../01AExample of using set, get, modify. BCDEFGHIJKLMNOPQRSTABCDEFGHIJKLMNOPQRSTABCDEFGHIJKLMNOPQRST 2An  Accessor r a" is an object that encodes how to  get and put a subject of type a out of/into an object  of type s. 0In order for an instance of this data structure a to be  an 2#, it must obey the following laws:  getVal a (setVal a x r) = x  setVal a (getVal a r) r = r 3 Construct an 2 from a get and a set method.  get method  set method 4AGet a value from a record field that is specified by an Accessor record field record "value of the field in the record 5?Set a value of a record field that is specified by an Accessor record field f value x to be set original record new record with field f changed to x 6Accessor composition: 5Combine an accessor with an accessor to a sub-field. Speak "stack". 7*Accessor composition the other direction.  (<.) = flip (.>) 8An "assignment operator" for state monads.  (=:) = putA 94A structural dereference function for state monads. :3A structural assignment function for state monads. ;5A structural modification function for state monads.  23456789:;2354 9:8;67 23456789:;U      !"#$%&'()**+,-./01234#56789:;<=>?@AB@ACDEFGHIJKLMNOPQRS   Tdata-accessor-0.2.0.2Data.Accessor.BasicData.Accessor.MonadStateData.Accessor.ContainerData.Accessor.ShowData.Accessor.TupleData.Accessor.BinaryRead Data.AccessorData.Accessor.ExampleT fromSetGetfromLensselfnullset^=composeget^.modify^:$%.><. getAndModify modifyAndGet%=%:liftliftTarray mapDefaultmapMaybe intMapDefault intMapMaybefield showsPrecfirstsecondfirst3second3third3Parser runParserByteCompatibletoByte ByteStreamgetWord8 ByteSource readWord8CanyStreamrecordAccessoraccessorgetValsetVal=:getAputAmodAConsdeconsbase Data.MaybeNothingJusttoMaybeplainstate stateInfix stateLiftinit initInfixreadinfix0infix1infix2infix3infix4 showsPairshow0show1