Source/Packages

Data.Bytes

packages/foundation/standard/src/Data/Bytes.alpha

1,218 lines172 declarations47.4 KiBSHA-256 beded7f8a171

def · lines 446–514

dataBytesSliceToBytesWithin

Full file
446def dataBytesSliceToBytesWithin =
447  (lambda unrestricted allocationLimit : Nat . unrestricted slice : (family DataBytesSlice) .
448    eliminate
449      DataBytesSlice
450      (lambda unrestricted current : (family DataBytesSlice) . family DataBytesResult)
451      slice
452      (branch DataBytesSliceView suffix requestedLength .
453        app
454          (lambda unrestricted suffixLength : Nat .
455            nat-eliminate
456              (lambda unrestricted current : Nat . family DataBytesResult)
457              (constructor
458                DataBytesResult
459                DataBytesFailed
460                (constructor DataBytesErrorCode DataBytesBuilderInvariantViolation)
461                (dataBytesTelemetry suffixLength requestedLength 0 0 0 0 0 allocationLimit))
462              (lambda unrestricted validPredecessor : Nat .
463                unrestricted validInduction : (family DataBytesResult) .
464                nat-eliminate
465                  (lambda unrestricted current : Nat . family DataBytesResult)
466                  (constructor
467                    DataBytesResult
468                    DataBytesFailed
469                    (constructor DataBytesErrorCode DataBytesAllocationLimitExceeded)
470                    (dataBytesTelemetry
471                      suffixLength
472                      requestedLength
473                      0
474                      0
475                      requestedLength
476                      0
477                      0
478                      allocationLimit))
479                  (lambda unrestricted limitPredecessor : Nat .
480                    unrestricted limitInduction : (family DataBytesResult) .
481                    nat-eliminate
482                      (lambda unrestricted current : Nat . family DataBytesResult)
483                      (constructor
484                        DataBytesResult
485                        DataBytesSucceeded
486                        (dataBytesTakeValidated requestedLength suffix)
487                        (dataBytesTelemetry
488                          suffixLength
489                          requestedLength
490                          requestedLength
491                          dataBytesNaturalOne
492                          0
493                          requestedLength
494                          requestedLength
495                          allocationLimit))
496                      (lambda unrestricted wholePredecessor : Nat .
497                        unrestricted wholeInduction : (family DataBytesResult) .
498                        constructor
499                          DataBytesResult
500                          DataBytesSucceeded
501                          suffix
502                          (dataBytesTelemetry
503                            suffixLength
504                            requestedLength
505                            requestedLength
506                            dataBytesNaturalOne
507                            requestedLength
508                            0
509                            0
510                            allocationLimit))
511                      (naturalEqual requestedLength suffixLength))
512                  (naturalLessOrEqual requestedLength allocationLimit))
513              (naturalLessOrEqual requestedLength suffixLength))
514          (bytes-length suffix)))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.