decodeModuleBinary function

Module decodeModuleBinary(
  1. List<int> bytes
)

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

Implementation

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