úÎZÍTyD      !"#$%&'()*+,-./0123456789:;<=>?@ABCSafeGZ!The strict sequence type. See Data.Nested.Seq.Lazy for more detailed information.Dempty sequenceE^even sequence (we will use a pattern synonym to maintain an invariant, hence the strange name)F odd sequenceWe maintain the invariant that (Z Nil)X never appears. This function checks whether this is satisfied. Used only for testing."Prepending an element. Worst case  O(log(n)), but amortized O(1). Worst case  O(log(n)) , amortized O(1).Checks whether the sequence is empty. This is O(1).The length of a sequence.  O(log(n)).The empty sequence.Conversion from a list. O(n).Conversion to a list. O(n). Naive implementation of *First element of the sequence. Worst case  O(log(n)) , amortized O(1).!Tail of the sequence. Worst case  O(log(n)) , amortized O(1).Last element of the sequence.  O(log(n)).*First element of the sequence. Worst case  O(log(n)) , amortized O(1).Last element of the sequence.  O(log(n))!Tail of the sequence. Worst case  O(log(n)) , amortized O(1).=All tails of the sequence (starting with the sequence itself) Lookup the k.-th element of a sequence. This is worst case  O(log(n)) and amortized  O(log(k)), and quite efficient. Update the k-th element of a sequence.  Replace the k -th element. !replace n x == update (const x) nDrop is efficient: drop k is amortized  O(log(k)), worst case maybe  O(log(n)^2) ?O(n) (for large n at least), where n% is the length of the first sequence.Take is slow: O(n)>The sequence without the last element. Warning, this is slow, O(n)>The sequence without the last element. Warning, this is slow, O(n)Warning, this is slow: O(n) (with bad constant factor).@Stripping the last element from a sequence is a slow operation, O(n)6. If you only need extracting the last element, use  instead, which is fast. DShow the internal structure of the sequence. The constructor names Z and O* come from "zero" and "one", respectively.!Generates a graphviz DOT3 file, showing the internal structure of a sequenceG.You can furthermore set the shape of the nodes?HIJDEFKLMNOPQRSTU  VWname of the three constuctors: (Nil,Even,Odd) precedence!GXYZ[\]^_`"  !"   !9HIJDEFKLMNOPQRSTU  VW!GXYZ[\]^_`SafeGZ!"The lazy sequence type.~The underlying (nested) data structure corresponds to the binary representation of the length of the list. It looks like this: @data Seq a = Nil | Even (Seq (a,a)) | Odd a (Seq (a,a))+Furthermore we maintain the invariant that Even Nil never appears.MFor example, here are how sequences of lengths 4, 5, 6 and 7 are represented: doc/seq4.png  doc/seq5.png  doc/seq6.png doc/seq7.pngaempty sequenceb^even sequence (we will use a pattern synonym to maintain an invariant, hence the strange name)c odd sequence#We maintain the invariant that (Z Nil)X never appears. This function checks whether this is satisfied. Used only for testing.$"Prepending an element. Worst case  O(log(n)), but amortized O(1).% Worst case  O(log(n)) , amortized O(1)&.Checks whether the sequence is empty. This is O(1).'The length of a sequence.  O(log(n)).(The empty sequence.)Conversion from a list. O(n).*Conversion to a list. O(n).+Naive implementation of *0*First element of the sequence. Worst case  O(log(n)) , amortized O(1).1!Tail of the sequence. Worst case  O(log(n)) , amortized O(1).2Last element of the sequence.  O(log(n)).3*First element of the sequence. Worst case  O(log(n)) , amortized O(1).4Last element of the sequence.  O(log(n))5!Tail of the sequence. Worst case  O(log(n)) , amortized O(1).6=All tails of the sequence (starting with the sequence itself)7 Lookup the k.-th element of a sequence. This is worst case  O(log(n)) and amortized  O(log(k)), and quite efficient.8 Update the k-th element of a sequence. 9 Replace the k -th element. !replace n x == update (const x) n;Drop is efficient: drop k is amortized  O(log(k)), worst case maybe  O(log(n)^2) ?<O(n) (for large n at least), where n% is the length of the first sequence.=Take is slow: O(n)>>The sequence without the last element. Warning, this is slow, O(n)?>The sequence without the last element. Warning, this is slow, O(n)@Warning, this is slow: O(n) (with bad constant factor).A@Stripping the last element from a sequence is a slow operation, O(n)6. If you only need extracting the last element, use 4 instead, which is fast. BDShow the internal structure of the sequence. The constructor names Z and O* come from "zero" and "one", respectively.CGenerates a graphviz DOT3 file, showing the internal structure of a sequenced.You can furthermore set the shape of the nodes=efgh"abcij#kl$%&'mno()*p+,-./0123456789:;<=>?@ABqrname of the three constuctors: (Nil,Even,Odd) precedenceCdstuvwxyz{""#$%&'()*+,-./0123456789:;<=>?@ABC""$%&'(*),-./01235647:89;<=>?@A+#BC8efgh"abcij#kl$%&'mno()*p+,-./0123456789:;<=>?@ABqrCdstuvwxyz{SafeZ""#$%&'()*+,-./0123456789:;<=>?@ABC|      !"#$%      !"#$%&'()**+,--,./0123456789:;<=>?&'()**+,,./0123456789:;<=>?@1RrFEZFwjcV4ng4XWpZxqBData.Nested.Seq.StrictData.Nested.Seq.LazyData.Nested.SeqSeqcheckInvariantconsunConsnulllengthemptyfromListtoList toListNaive singletonpairtriplequadheadtaillastmbHeadmbLastmbTailtailslookupupdatereplacembLookupdropappendtakeinitmbInitsnocunSnoc showInternalgraphvizNilZZO graphviz'StaterunStatePair StrictPairZfstsndsafeNull unsafeNull seqLength seqToListshowsPrecInternalshowsPrecInternal'$fApplicativeState $fMonadState$fFunctorState $fFoldableSeq $fFunctorSeq $fShowSeq$fOrdSeq$fEqSeq $fMonoidSeq