decodeProgramBinary function

Program decodeProgramBinary(
  1. List<int> bytes
)

Decodes a Program from a binary ball file, or throws if it wraps a Module.

Implementation

Program decodeProgramBinary(List<int> bytes) =>
    switch (decodeBallFileBinary(bytes)) {
      BallProgramFile(:final program) => program,
      BallModuleFile() => throw BallFileFormatException(
        'expected a Program ball file but got a Module',
      ),
    };