From 1ef46a3c65fa3d0140ef2710261454c1abf6bca1 Mon Sep 17 00:00:00 2001 From: Mario Rogic Date: Wed, 8 Nov 2023 15:59:11 +0000 Subject: [PATCH] Support custom types with 256-65535 variants --- ext-common/Ext/Common.hs | 16 +- extra/Lamdera/Compile.hs | 8 +- extra/Lamdera/Evaluate/Optimized.hs | 2 - extra/Lamdera/Injection.hs | 12 +- extra/Lamdera/Wire3/Core.hs | 82 +- extra/Lamdera/Wire3/Helpers.hs | 74 +- test/scenario-alltypes/src/Test/External.elm | 6 +- .../src/Test/Wire_Union_5_Massive.elm | 2342 +++++++++++++++++ 8 files changed, 2494 insertions(+), 48 deletions(-) create mode 100644 test/scenario-alltypes/src/Test/Wire_Union_5_Massive.elm diff --git a/ext-common/Ext/Common.hs b/ext-common/Ext/Common.hs index 0975505a4..7b4a95711 100644 --- a/ext-common/Ext/Common.hs +++ b/ext-common/Ext/Common.hs @@ -130,6 +130,16 @@ getProjectRoot tag = do -- debug $ "๐Ÿ  read project root [" <> tag <> "]: " <> root pure root +getProjectRoot_ :: String -> IO (Maybe FilePath) +getProjectRoot_ tag = do + root <- readMVar projectRootMvar + case root of + ProjectRootUnset -> pure Nothing + ProjectRootSet root -> do + pure $ Just root + ProjectRootContextual root -> do + pure $ Just root + getProjectRootMaybe :: IO (Maybe FilePath) getProjectRootMaybe = do @@ -139,10 +149,12 @@ getProjectRootMaybe = do withProjectRoot :: FilePath -> IO a -> IO a withProjectRoot root io = do - originalRoot <- getProjectRoot "withProjectRoot" + originalRootM <- getProjectRoot_ "withProjectRoot" setProjectRoot root !res <- Dir.withCurrentDirectory root io - setProjectRoot originalRoot + case originalRootM of + Just originalRoot -> setProjectRoot originalRoot + Nothing -> pure () pure res diff --git a/extra/Lamdera/Compile.hs b/extra/Lamdera/Compile.hs index 7d6eb0fcb..d4809cdc9 100644 --- a/extra/Lamdera/Compile.hs +++ b/extra/Lamdera/Compile.hs @@ -22,7 +22,7 @@ makeOptimized root path = do -- Runs `lamdera make --optimize` of given files with no output, followed by the cleanup IO makeOptimizedWithCleanup :: IO () -> FilePath -> FilePath -> IO () makeOptimizedWithCleanup cleanup root path = do - debug $ "๐Ÿ— lamdera make --optimize " <> root <> "/" <> path + debug $ "๐Ÿ— makeOptimizedWithCleanup: lamdera make --optimize " <> root <> "/" <> path let tmp = lamderaCache root <> "/tmp.js" scaffold = lamderaCache root <> "/Main_.elm" @@ -55,7 +55,7 @@ makeOptimizedWithCleanup cleanup root path = do -- Runs `lamdera make` with no JS output make_ :: FilePath -> IO () make_ root = do - debug $ "๐Ÿ— lamdera make " <> root <> "/" + debug $ "๐Ÿ— make_: lamdera make " <> root <> "/" r <- async $ Ext.Common.withProjectRoot root $ @@ -80,7 +80,7 @@ make_ root = do -- Runs `lamdera make` of given files with no JS file output makeDev :: FilePath -> [FilePath] -> IO () makeDev root paths = do - debug $ "๐Ÿ— lamdera make " <> root <> "/" <> show paths + debug $ "๐Ÿ— makeDev: lamdera make " <> root <> "/" <> show paths absRoot <- Dir.makeAbsolute root @@ -116,7 +116,7 @@ makeHarnessDevJs root = do tmp = lamderaCache root <> "/tmp.js" scaffold = lamderaCache root <> "/Main_.elm" - debug $ "๐Ÿ— lamdera make " <> scaffold + debug $ "๐Ÿ— makeHarnessDevJs: lamdera make " <> scaffold writeUtf8 scaffold "module Main_ exposing (..)\n\nimport Frontend\nimport Backend\nimport Types\nimport Html\n\nmain = Html.text \"\"" diff --git a/extra/Lamdera/Evaluate/Optimized.hs b/extra/Lamdera/Evaluate/Optimized.hs index fc01b5134..4feb39967 100644 --- a/extra/Lamdera/Evaluate/Optimized.hs +++ b/extra/Lamdera/Evaluate/Optimized.hs @@ -141,12 +141,10 @@ evalExpr expr locals globals = (Call (VarGlobal (Global (Module.Canonical (Name "elm" "core") "Basics") "eq")) [arg1, arg2]) -> case [evalExpr arg1 locals globals, evalExpr arg2 locals globals] of [a_, b] -> Bool $ a_ == b - _ -> error $ "unexpected args to Basics.eq: " <> show [arg1, arg2] (Call (VarGlobal (Global (Module.Canonical (Name "elm" "core") "Basics") "neq")) [arg1, arg2]) -> case [evalExpr arg1 locals globals, evalExpr arg2 locals globals] of [a_, b] -> Bool $ a_ /= b - _ -> error $ "unexpected args to Basics.neq: " <> show [arg1, arg2] (Call (VarGlobal (Global (Module.Canonical (Name "elm" "core") "Basics") "append")) [arg1, arg2]) -> case [evalExpr arg1 locals globals, evalExpr arg2 locals globals] of diff --git a/extra/Lamdera/Injection.hs b/extra/Lamdera/Injection.hs index 144ba66c8..ef1164769 100644 --- a/extra/Lamdera/Injection.hs +++ b/extra/Lamdera/Injection.hs @@ -348,7 +348,7 @@ elmPkgJs mode = (Just esbuildConfigPath, _, _) -> if Ext.Common.isDebug_ then do - Lamdera.debug_ "Building esbuild.config.js" + Lamdera.debug_ "๐Ÿ—๏ธ Building esbuild.config.js" hasNode <- Dir.findExecutable "node" minFile <- case hasNode of Just node -> do @@ -363,15 +363,17 @@ elmPkgJs mode = Nothing -> do error "no min file after compile, run `node esbuild.config.js` to check errors" else do - Lamdera.debug_ "Using dumb js packager" + Lamdera.debug_ "๐Ÿ—๏ธ๐ŸŸ  Using dumbJsPackager, ignoring esbuild.config.js in non-dev mode" dumbJsPackager root elmPkgJsSources (_, Just esbuildPath, Just includesPath) -> if Ext.Common.isDebug_ then do esbuildIncluder root esbuildPath includesPath else do + Lamdera.debug_ "๐Ÿ—๏ธ๐ŸŸ  Using dumbJsPackager, ignoring esbuild in non-dev mode" dumbJsPackager root elmPkgJsSources - _ -> + _ -> do + Lamdera.debug_ "๐Ÿ—๏ธ Using dumbJsPackager" dumbJsPackager root elmPkgJsSources _ -> "" @@ -382,10 +384,10 @@ esbuildIncluder root esbuildPath includesPath = do minFile <- Lamdera.Relative.loadFile $ root "elm-pkg-js-includes.min.js" case minFile of Just minFileContents -> do - Lamdera.debug_ "Using cached elm-pkg-js-includes.min.js" + Lamdera.debug_ "๐Ÿ—๏ธ Using cached elm-pkg-js-includes.min.js" pure $ Ext.Common.textToBuilder minFileContents Nothing -> do - Lamdera.debug_ "Building elm-pkg-js-includes.js" + Lamdera.debug_ "๐Ÿ—๏ธ Building elm-pkg-js-includes.js" -- packaged <- Ext.Common.cq_ esbuildPath [ includesPath, "--bundle", "--global-name=elmPkgJsIncludes" ] "" (exit, packaged, stdErr) <- Ext.Common.cq_ esbuildPath [ includesPath, "--bundle", "--minify", "--global-name=elmPkgJsIncludes" ] "" packaged diff --git a/extra/Lamdera/Wire3/Core.hs b/extra/Lamdera/Wire3/Core.hs index 89a477366..52d2823e8 100644 --- a/extra/Lamdera/Wire3/Core.hs +++ b/extra/Lamdera/Wire3/Core.hs @@ -42,8 +42,8 @@ import Lamdera.Wire3.Graph import qualified Ext.ElmFormat -runTests isTest debugName pkg modul decls generatedName generated canonicalValue wiregen = - if isTest +runTests isTest_ debugName pkg modul decls generatedName generated canonicalValue wiregen = + if isTest_ then unsafePerformIO $ do let @@ -83,8 +83,8 @@ runTests isTest debugName pkg modul decls generatedName generated canonicalValue -- debugPassText ("๐Ÿงก expected implementation pretty-printed " <> show_ (Src.getName modul)) (Source2.generateCodecs Map.empty wiregen) (pure ()) -- debugHaskellPass ("๐Ÿงก expected implementation AST.Canonical " <> show_ (Src.getName modul)) (testDefinition) (pure ()) - diff <- icdiff (hindentFormatValue testDefinition) (hindentFormatValue generated) - diff2 <- icdiff (ToSource.convert testDefinition) (ToSource.convert generated) + -- diff <- icdiff (hindentFormatValue testDefinition) (hindentFormatValue generated) + diff2 <- icdiff (ToSource.convert (testDefinition `withName` generatedName)) (ToSource.convert generated) -- diff2 <- do -- l <- Ext.ElmFormat.format $ ToSource.convert testDefinition -- r <- Ext.ElmFormat.format $ ToSource.convert generated @@ -93,8 +93,8 @@ runTests isTest debugName pkg modul decls generatedName generated canonicalValue -- Left err -> show_ err -- Right t -> t -- icdiff (withDefault l) (withDefault r) - atomicPutStrLn $ "โŒโŒโŒ failed, attempting pretty-print diff1:\n" ++ diff - atomicPutStrLn $ "โŒโŒโŒ failed, attempting pretty-print diff2:\n" ++ diff2 + -- atomicPutStrLn $ "โŒโŒโŒ failed, attempting pretty-print diff1:\n" ++ diff + atomicPutStrLn $ "โŒโŒโŒ ASTs do not match, attempting pretty-print diff2:\n" ++ diff2 -- error "exiting!" -- atomicPutStrLn $ "โŒโŒโŒ " ++ Data.Name.toChars (Src.getName modul) ++ "." ++ Data.Name.toChars generatedName ++ " gen does not match test definition." pure () @@ -147,7 +147,7 @@ addWireGenerations canonical pkg ifaces modul = addWireGenerations_ :: Can.Module -> Pkg.Name -> Map.Map Module.Raw I.Interface -> Src.Module -> Either D.Doc Can.Module addWireGenerations_ canonical pkg ifaces modul = let - !isTest = unsafePerformIO Lamdera.isTest + !isTest_ = unsafePerformIO Lamdera.isTest -- !x = unsafePerformIO $ do -- case (pkg, Src.getName modul) of @@ -179,8 +179,8 @@ addWireGenerations_ canonical pkg ifaces modul = (Can._unions canonical) & Map.toList & concatMap (\(name, union) -> - [ (encoderUnion isTest ifaces pkg modul decls_ name union) - , (decoderUnion isTest ifaces pkg modul decls_ name union) + [ (encoderUnion isTest_ ifaces pkg modul decls_ name union) + , (decoderUnion isTest_ ifaces pkg modul decls_ name union) ] ) @@ -188,8 +188,8 @@ addWireGenerations_ canonical pkg ifaces modul = (Can._aliases canonical) & Map.toList & concatMap (\(name, alias) -> - [ (encoderAlias isTest ifaces pkg modul decls_ name alias) - , (decoderAlias isTest ifaces pkg modul decls_ name alias) + [ (encoderAlias isTest_ ifaces pkg modul decls_ name alias) + , (decoderAlias isTest_ ifaces pkg modul decls_ name alias) ] ) @@ -211,7 +211,7 @@ addWireGenerations_ canonical pkg ifaces modul = issues, so we have a record of the things we've tried. -} oldDeclsImpl = declsToList decls_ - & List.unionBy (\a b -> defName a == defName b) (unionDefs ++ aliasDefs) + & List.unionBy (\a_ b -> defName a_ == defName b) (unionDefs ++ aliasDefs) & Lamdera.Wire3.Graph.stronglyConnCompDefs & Lamdera.Wire3.Graph.addGraphDefsToDecls SaveTheEnvironment @@ -223,8 +223,8 @@ addWireGenerations_ canonical pkg ifaces modul = Export exports -> newDefs - & foldl (\exports def -> - addExport def exports + & foldl (\exports_ def -> + addExport def exports_ ) exports & Export @@ -245,9 +245,9 @@ addExport def exports = encoderUnion :: Bool -> Map.Map Module.Raw I.Interface -> Pkg.Name -> Src.Module -> Decls -> Data.Name.Name -> Union -> Def -encoderUnion isTest ifaces pkg modul decls unionName union = +encoderUnion isTest_ ifaces pkg modul decls unionName union = let - !x = runTests isTest "encoderUnion" pkg modul decls generatedName finalGen union (unionAsModule cname unionName union) + !x = runTests isTest_ "encoderUnion" pkg modul decls generatedName finalGen union (unionAsModule cname unionName union) generatedName = Data.Name.fromChars $ "w3_encode_" ++ Data.Name.toChars unionName cname = Module.Canonical pkg (Src.getName modul) @@ -258,6 +258,15 @@ encoderUnion isTest ifaces pkg modul decls unionName union = (pvar $ Data.Name.fromChars $ "w3_x_c_" ++ Data.Name.toChars tvar, TLambda (TVar tvar) tLamdera_Wire_Encoder_Holey) ) + numCtors = length $ _u_alts union + + variantIntEncoder n + | numCtors <= 255 = encodeUnsignedInt8 (int n) + | numCtors <= 65535 = encodeUnsignedInt16 (int n) + -- Truly ridiculous but... maybe one day? ๐Ÿช + -- | numCtors <= 4294967295 = encodeUnsignedInt32 (int n) + | otherwise = error $ "Unhandled custom type variant size (" ++ show n ++ "), please report this issue for the custom type " ++ Data.Name.toChars unionName + generatedBody = -- debugEncoder_ (Data.Name.toElmString unionName) (caseof (lvar "w3v") $ @@ -266,18 +275,24 @@ encoderUnion isTest ifaces pkg modul decls unionName union = & imap (\i (Ctor tagName tagIndex numParams paramTypes) -> let params = - paramTypes & imap (\i paramType -> + paramTypes & imap (\pi_ paramType -> PatternCtorArg - { _index = Index.ZeroBased i + { _index = Index.ZeroBased pi_ , _type = paramType - , _arg = pvar (Data.Name.fromChars $ "v" ++ show i) + , _arg = pvar (Data.Name.fromChars $ "v" ++ show pi_) } ) paramEncoders = - paramTypes & imap (\i paramType -> - encodeTypeValue 0 ifaces cname paramType (lvar (Data.Name.fromChars $ "v" ++ show i)) + paramTypes & imap (\pi_ paramType -> + encodeTypeValue 0 ifaces cname paramType (lvar (Data.Name.fromChars $ "v" ++ show pi_)) ) + + branchHandler = + if numParams == 0 then + variantIntEncoder i + else + encodeSequenceWithoutLength $ list $ [ variantIntEncoder i ] ++ paramEncoders in CaseBranch (a (PCtor @@ -288,7 +303,7 @@ encoderUnion isTest ifaces pkg modul decls unionName union = , _p_index = tagIndex , _p_args = params })) - (encodeSequenceWithoutLength $ list $ [ encodeUnsignedInt8 (int i) ] ++ paramEncoders) + branchHandler ) ) @@ -318,9 +333,9 @@ encoderUnion isTest ifaces pkg modul decls unionName union = decoderUnion :: Bool -> Map.Map Module.Raw I.Interface -> Pkg.Name -> Src.Module -> Decls -> Data.Name.Name -> Union -> Def -decoderUnion isTest ifaces pkg modul decls unionName union = +decoderUnion isTest_ ifaces pkg modul decls unionName union = let - !x = runTests isTest "decoderUnion" pkg modul decls generatedName generated union (unionAsModule cname unionName union) + !x = runTests isTest_ "decoderUnion" pkg modul decls generatedName generated union (unionAsModule cname unionName union) generatedName = Data.Name.fromChars $ "w3_decode_" ++ Data.Name.toChars unionName cname = Module.Canonical pkg (Src.getName modul) @@ -336,6 +351,15 @@ decoderUnion isTest ifaces pkg modul decls unionName union = in (a (VarCtor (_u_opts union) cname tagName index (Forall tvarsTypesig constructorType))) + numCtors = length $ _u_alts union + + variantIntDecoder + | numCtors <= 255 = decodeUnsignedInt8 + | numCtors <= 65535 = decodeUnsignedInt16 + -- Truly ridiculous but... maybe one day? ๐Ÿช + -- | numCtors <= 4294967295 = decodeUnsignedInt32 + | otherwise = error $ "Unhandled custom type variant size (" ++ show numCtors ++ "), please report this issue for the custom type " ++ Data.Name.toChars unionName + generated = Def -- TypedDef @@ -343,7 +367,7 @@ decoderUnion isTest ifaces pkg modul decls unionName union = -- Map.empty ptvars $ -- debugDecoder (Data.Name.toElmString unionName) - (decodeUnsignedInt8 |> andThenDecode1 + (variantIntDecoder |> andThenDecode1 (lambda1 (pvar "w3v") $ caseof (lvar "w3v") $ _u_alts union @@ -367,9 +391,9 @@ decoderUnion isTest ifaces pkg modul decls unionName union = encoderAlias :: Bool -> Map.Map Module.Raw I.Interface -> Pkg.Name -> Src.Module -> Decls -> Data.Name.Name -> Alias -> Def -encoderAlias isTest ifaces pkg modul decls aliasName alias@(Alias tvars tipe) = +encoderAlias isTest_ ifaces pkg modul decls aliasName alias@(Alias tvars tipe) = let - !x = runTests isTest "encoderAlias" pkg modul decls generatedName finalGen alias (aliasAsModule cname aliasName alias) + !x = runTests isTest_ "encoderAlias" pkg modul decls generatedName finalGen alias (aliasAsModule cname aliasName alias) generatedName = Data.Name.fromChars $ "w3_encode_" ++ Data.Name.toChars aliasName cname = Module.Canonical pkg (Src.getName modul) @@ -424,9 +448,9 @@ encoderAlias isTest ifaces pkg modul decls aliasName alias@(Alias tvars tipe) = decoderAlias :: Bool -> Map.Map Module.Raw I.Interface -> Pkg.Name -> Src.Module -> Decls -> Data.Name.Name -> Alias -> Def -decoderAlias isTest ifaces pkg modul decls aliasName alias@(Alias tvars tipe) = +decoderAlias isTest_ ifaces pkg modul decls aliasName alias@(Alias tvars tipe) = let - !x = runTests isTest "decoderAlias" pkg modul decls generatedName generated alias (aliasAsModule cname aliasName alias) + !x = runTests isTest_ "decoderAlias" pkg modul decls generatedName generated alias (aliasAsModule cname aliasName alias) generatedName = Data.Name.fromChars $ "w3_decode_" ++ Data.Name.toChars aliasName cname = Module.Canonical pkg (Src.getName modul) diff --git a/extra/Lamdera/Wire3/Helpers.hs b/extra/Lamdera/Wire3/Helpers.hs index 6d6eff0f9..1c9d8c0b4 100644 --- a/extra/Lamdera/Wire3/Helpers.hs +++ b/extra/Lamdera/Wire3/Helpers.hs @@ -409,8 +409,19 @@ namedTodo modul functionName = a v = A.at (A.Position 0 0) (A.Position 0 10) v +-- Refer to Lamdera.Wire3.endianness +endianness = + a (VarForeign mLamdera_Wire "endianness" + (Forall + Map.empty + (TType + (Module.Canonical (Name "elm" "bytes") "Bytes") + "Endianness" + []))) + encodeSequenceWithoutLength list = + -- @TODO we could optimise all sequences of length 1 to not use the sequence encoding ? (a (Call (a (VarForeign mLamdera_Wire "encodeSequenceWithoutLength" (Forall Map.empty @@ -425,7 +436,29 @@ encodeSequenceWithoutLength list = encodeUnsignedInt8 value = - (a (Call (a (VarForeign mLamdera_Wire "encodeUnsignedInt8" + (a (Call (a (VarForeign mBytes_Encode "unsignedInt8" + (Forall + Map.empty + (TLambda + (TType (Module.Canonical (Name "elm" "core") "Basics") "Int" []) + tLamdera_Wire_Encoder)))) + [value])) + + +encodeUnsignedInt16 value = + (a (Call (a (VarForeign mBytes_Encode "unsignedInt16" + (Forall + Map.empty + (TLambda + ((TType (Module.Canonical (Name "elm" "bytes") "Bytes") "Endianness" [])) + (TLambda + (TType (Module.Canonical (Name "elm" "core") "Basics") "Int" []) + tLamdera_Wire_Encoder))))) + [endianness, value])) + + +encodeInt value = + (a (Call (a (VarForeign mLamdera_Wire "encodeInt" (Forall Map.empty (TLambda @@ -449,6 +482,38 @@ decodeUnsignedInt8 = [TType (Module.Canonical (Name "elm" "core") "Basics") "Int" []])))))) +decodeUnsignedInt16 = + a (Call (a (VarForeign mBytes_Decode "unsignedInt16" + (Forall + Map.empty + (TLambda + (TType (Module.Canonical (Name "elm" "bytes") "Bytes") "Endianness" []) + (TAlias + mLamdera_Wire + "Decoder" + [("a", TType (Module.Canonical (Name "elm" "core") "Basics") "Int" [])] + (Filled + (TType + (Module.Canonical (Name "elm" "bytes") "Bytes.Decode") + "Decoder" + [TType (Module.Canonical (Name "elm" "core") "Basics") "Int" []]))))))) + [endianness] + ) + + +decodeInt = + (a (VarForeign mLamdera_Wire "decodeInt" + (Forall + Map.empty + (TAlias + mLamdera_Wire + "Decoder" + [("a", TType (Module.Canonical (Name "elm" "core") "Basics") "Int" [])] + (Filled + (TType + (Module.Canonical (Name "elm" "bytes") "Bytes.Decode") + "Decoder" + [TType (Module.Canonical (Name "elm" "core") "Basics") "Int" []])))))) decodeTime = @@ -619,6 +684,8 @@ int value = str value = a (Str value) + +list :: [Expr] -> A.Located Expr_ list values = a (List values) @@ -678,8 +745,9 @@ tLamdera_Wire_Encoder_Holey = (Holey (TType (Module.Canonical (Name "elm" "bytes") "Bytes.Encode") "Encoder" []))) -mLamdera_Wire = - (Module.Canonical (Name "lamdera" "codecs") "Lamdera.Wire3") +mLamdera_Wire = (Module.Canonical (Name "lamdera" "codecs") "Lamdera.Wire3") +mBytes_Encode = (Module.Canonical (Name "elm" "bytes") "Bytes.Encode") +mBytes_Decode = (Module.Canonical (Name "elm" "bytes") "Bytes.Decode") foldlPairs fn list = diff --git a/test/scenario-alltypes/src/Test/External.elm b/test/scenario-alltypes/src/Test/External.elm index 15ca92039..beeaed5e5 100644 --- a/test/scenario-alltypes/src/Test/External.elm +++ b/test/scenario-alltypes/src/Test/External.elm @@ -41,10 +41,10 @@ expected_w3_encode_ExternalCustomBasic : ExternalCustomBasic -> Lamdera.Wire3.En expected_w3_encode_ExternalCustomBasic w3v = case w3v of Custom1 -> - Lamdera.Wire3.encodeSequenceWithoutLength [ Lamdera.Wire3.encodeUnsignedInt8 0 ] + Lamdera.Wire3.encodeUnsignedInt8 0 Custom2 -> - Lamdera.Wire3.encodeSequenceWithoutLength [ Lamdera.Wire3.encodeUnsignedInt8 1 ] + Lamdera.Wire3.encodeUnsignedInt8 1 expected_w3_decode_ExternalCustomBasic = @@ -91,7 +91,7 @@ expected_w3_encode_ExternalCustomThreaded w3_x_c_threadedTvar w3_x_c_threadedTva Lamdera.Wire3.encodeSequenceWithoutLength [ Lamdera.Wire3.encodeUnsignedInt8 1, w3_x_c_threadedTvar v0 ] AlphabeticallyLast -> - Lamdera.Wire3.encodeSequenceWithoutLength [ Lamdera.Wire3.encodeUnsignedInt8 2 ] + Lamdera.Wire3.encodeUnsignedInt8 2 expected_w3_decode_ExternalCustomThreaded w3_x_c_threadedTvar w3_x_c_threadedTvar2 = diff --git a/test/scenario-alltypes/src/Test/Wire_Union_5_Massive.elm b/test/scenario-alltypes/src/Test/Wire_Union_5_Massive.elm new file mode 100644 index 000000000..f07964ecb --- /dev/null +++ b/test/scenario-alltypes/src/Test/Wire_Union_5_Massive.elm @@ -0,0 +1,2342 @@ +module Test.Wire_Union_5_Massive exposing (..) + +import Array exposing (Array) +import Bytes.Decode +import Bytes.Encode +import Dict exposing (Dict) +import Lamdera.Wire3 +import Set exposing (Set) +import Test.External exposing (..) + + +{-| 256 variants +-} +type UnionMassive + = V001 + | V002 + | V003 + | V004 + | V005 + | V006 + | V007 + | V008 + | V009 + | V010 + | V011 + | V012 + | V013 + | V014 + | V015 + | V016 + | V017 + | V018 + | V019 + | V020 + | V021 + | V022 + | V023 + | V024 + | V025 + | V026 + | V027 + | V028 + | V029 + | V030 + | V031 + | V032 + | V033 + | V034 + | V035 + | V036 + | V037 + | V038 + | V039 + | V040 + | V041 + | V042 + | V043 + | V044 + | V045 + | V046 + | V047 + | V048 + | V049 + | V050 + | V051 + | V052 + | V053 + | V054 + | V055 + | V056 + | V057 + | V058 + | V059 + | V060 + | V061 + | V062 + | V063 + | V064 + | V065 + | V066 + | V067 + | V068 + | V069 + | V070 + | V071 + | V072 + | V073 + | V074 + | V075 + | V076 + | V077 + | V078 + | V079 + | V080 + | V081 + | V082 + | V083 + | V084 + | V085 + | V086 + | V087 + | V088 + | V089 + | V090 + | V091 + | V092 + | V093 + | V094 + | V095 + | V096 + | V097 + | V098 + | V099 + | V100 + | V101 + | V102 + | V103 + | V104 + | V105 + | V106 + | V107 + | V108 + | V109 + | V110 + | V111 + | V112 + | V113 + | V114 + | V115 + | V116 + | V117 + | V118 + | V119 + | V120 + | V121 + | V122 + | V123 + | V124 + | V125 + | V126 + | V127 + | V128 + | V129 + | V130 + | V131 + | V132 + | V133 + | V134 + | V135 + | V136 + | V137 + | V138 + | V139 + | V140 + | V141 + | V142 + | V143 + | V144 + | V145 + | V146 + | V147 + | V148 + | V149 + | V150 + | V151 + | V152 + | V153 + | V154 + | V155 + | V156 + | V157 + | V158 + | V159 + | V160 + | V161 + | V162 + | V163 + | V164 + | V165 + | V166 + | V167 + | V168 + | V169 + | V170 + | V171 + | V172 + | V173 + | V174 + | V175 + | V176 + | V177 + | V178 + | V179 + | V180 + | V181 + | V182 + | V183 + | V184 + | V185 + | V186 + | V187 + | V188 + | V189 + | V190 + | V191 + | V192 + | V193 + | V194 + | V195 + | V196 + | V197 + | V198 + | V199 + | V200 + | V201 + | V202 + | V203 + | V204 + | V205 + | V206 + | V207 + | V208 + | V209 + | V210 + | V211 + | V212 + | V213 + | V214 + | V215 + | V216 + | V217 + | V218 + | V219 + | V220 + | V221 + | V222 + | V223 + | V224 + | V225 + | V226 + | V227 + | V228 + | V229 + | V230 + | V231 + | V232 + | V233 + | V234 + | V235 + | V236 + | V237 + | V238 + | V239 + | V240 + | V241 + | V242 + | V243 + | V244 + | V245 + | V246 + | V247 + | V248 + | V249 + | V250 + | V251 + | V252 + | V253 + | V254 + | V255 + | V256 + | V257 + + +expected_w3_encode_UnionMassive : UnionMassive -> Lamdera.Wire3.Encoder +expected_w3_encode_UnionMassive w3v = + case w3v of + V001 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 0 + + V002 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 1 + + V003 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 2 + + V004 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 3 + + V005 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 4 + + V006 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 5 + + V007 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 6 + + V008 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 7 + + V009 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 8 + + V010 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 9 + + V011 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 10 + + V012 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 11 + + V013 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 12 + + V014 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 13 + + V015 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 14 + + V016 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 15 + + V017 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 16 + + V018 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 17 + + V019 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 18 + + V020 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 19 + + V021 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 20 + + V022 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 21 + + V023 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 22 + + V024 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 23 + + V025 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 24 + + V026 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 25 + + V027 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 26 + + V028 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 27 + + V029 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 28 + + V030 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 29 + + V031 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 30 + + V032 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 31 + + V033 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 32 + + V034 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 33 + + V035 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 34 + + V036 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 35 + + V037 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 36 + + V038 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 37 + + V039 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 38 + + V040 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 39 + + V041 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 40 + + V042 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 41 + + V043 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 42 + + V044 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 43 + + V045 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 44 + + V046 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 45 + + V047 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 46 + + V048 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 47 + + V049 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 48 + + V050 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 49 + + V051 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 50 + + V052 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 51 + + V053 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 52 + + V054 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 53 + + V055 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 54 + + V056 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 55 + + V057 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 56 + + V058 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 57 + + V059 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 58 + + V060 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 59 + + V061 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 60 + + V062 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 61 + + V063 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 62 + + V064 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 63 + + V065 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 64 + + V066 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 65 + + V067 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 66 + + V068 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 67 + + V069 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 68 + + V070 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 69 + + V071 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 70 + + V072 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 71 + + V073 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 72 + + V074 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 73 + + V075 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 74 + + V076 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 75 + + V077 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 76 + + V078 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 77 + + V079 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 78 + + V080 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 79 + + V081 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 80 + + V082 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 81 + + V083 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 82 + + V084 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 83 + + V085 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 84 + + V086 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 85 + + V087 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 86 + + V088 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 87 + + V089 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 88 + + V090 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 89 + + V091 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 90 + + V092 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 91 + + V093 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 92 + + V094 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 93 + + V095 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 94 + + V096 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 95 + + V097 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 96 + + V098 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 97 + + V099 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 98 + + V100 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 99 + + V101 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 100 + + V102 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 101 + + V103 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 102 + + V104 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 103 + + V105 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 104 + + V106 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 105 + + V107 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 106 + + V108 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 107 + + V109 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 108 + + V110 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 109 + + V111 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 110 + + V112 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 111 + + V113 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 112 + + V114 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 113 + + V115 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 114 + + V116 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 115 + + V117 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 116 + + V118 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 117 + + V119 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 118 + + V120 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 119 + + V121 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 120 + + V122 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 121 + + V123 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 122 + + V124 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 123 + + V125 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 124 + + V126 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 125 + + V127 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 126 + + V128 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 127 + + V129 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 128 + + V130 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 129 + + V131 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 130 + + V132 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 131 + + V133 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 132 + + V134 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 133 + + V135 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 134 + + V136 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 135 + + V137 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 136 + + V138 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 137 + + V139 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 138 + + V140 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 139 + + V141 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 140 + + V142 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 141 + + V143 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 142 + + V144 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 143 + + V145 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 144 + + V146 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 145 + + V147 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 146 + + V148 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 147 + + V149 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 148 + + V150 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 149 + + V151 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 150 + + V152 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 151 + + V153 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 152 + + V154 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 153 + + V155 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 154 + + V156 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 155 + + V157 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 156 + + V158 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 157 + + V159 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 158 + + V160 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 159 + + V161 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 160 + + V162 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 161 + + V163 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 162 + + V164 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 163 + + V165 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 164 + + V166 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 165 + + V167 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 166 + + V168 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 167 + + V169 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 168 + + V170 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 169 + + V171 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 170 + + V172 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 171 + + V173 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 172 + + V174 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 173 + + V175 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 174 + + V176 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 175 + + V177 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 176 + + V178 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 177 + + V179 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 178 + + V180 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 179 + + V181 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 180 + + V182 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 181 + + V183 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 182 + + V184 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 183 + + V185 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 184 + + V186 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 185 + + V187 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 186 + + V188 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 187 + + V189 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 188 + + V190 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 189 + + V191 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 190 + + V192 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 191 + + V193 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 192 + + V194 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 193 + + V195 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 194 + + V196 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 195 + + V197 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 196 + + V198 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 197 + + V199 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 198 + + V200 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 199 + + V201 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 200 + + V202 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 201 + + V203 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 202 + + V204 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 203 + + V205 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 204 + + V206 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 205 + + V207 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 206 + + V208 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 207 + + V209 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 208 + + V210 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 209 + + V211 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 210 + + V212 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 211 + + V213 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 212 + + V214 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 213 + + V215 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 214 + + V216 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 215 + + V217 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 216 + + V218 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 217 + + V219 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 218 + + V220 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 219 + + V221 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 220 + + V222 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 221 + + V223 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 222 + + V224 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 223 + + V225 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 224 + + V226 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 225 + + V227 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 226 + + V228 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 227 + + V229 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 228 + + V230 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 229 + + V231 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 230 + + V232 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 231 + + V233 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 232 + + V234 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 233 + + V235 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 234 + + V236 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 235 + + V237 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 236 + + V238 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 237 + + V239 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 238 + + V240 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 239 + + V241 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 240 + + V242 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 241 + + V243 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 242 + + V244 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 243 + + V245 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 244 + + V246 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 245 + + V247 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 246 + + V248 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 247 + + V249 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 248 + + V250 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 249 + + V251 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 250 + + V252 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 251 + + V253 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 252 + + V254 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 253 + + V255 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 254 + + V256 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 255 + + V257 -> + Bytes.Encode.unsignedInt16 Lamdera.Wire3.endianness + 256 + + +expected_w3_decode_UnionMassive = + Bytes.Decode.unsignedInt16 + Lamdera.Wire3.endianness + |> Lamdera.Wire3.andThenDecode + (\w3v -> + case w3v of + 0 -> + Lamdera.Wire3.succeedDecode + V001 + + 1 -> + Lamdera.Wire3.succeedDecode + V002 + + 2 -> + Lamdera.Wire3.succeedDecode + V003 + + 3 -> + Lamdera.Wire3.succeedDecode + V004 + + 4 -> + Lamdera.Wire3.succeedDecode + V005 + + 5 -> + Lamdera.Wire3.succeedDecode + V006 + + 6 -> + Lamdera.Wire3.succeedDecode + V007 + + 7 -> + Lamdera.Wire3.succeedDecode + V008 + + 8 -> + Lamdera.Wire3.succeedDecode + V009 + + 9 -> + Lamdera.Wire3.succeedDecode + V010 + + 10 -> + Lamdera.Wire3.succeedDecode + V011 + + 11 -> + Lamdera.Wire3.succeedDecode + V012 + + 12 -> + Lamdera.Wire3.succeedDecode + V013 + + 13 -> + Lamdera.Wire3.succeedDecode + V014 + + 14 -> + Lamdera.Wire3.succeedDecode + V015 + + 15 -> + Lamdera.Wire3.succeedDecode + V016 + + 16 -> + Lamdera.Wire3.succeedDecode + V017 + + 17 -> + Lamdera.Wire3.succeedDecode + V018 + + 18 -> + Lamdera.Wire3.succeedDecode + V019 + + 19 -> + Lamdera.Wire3.succeedDecode + V020 + + 20 -> + Lamdera.Wire3.succeedDecode + V021 + + 21 -> + Lamdera.Wire3.succeedDecode + V022 + + 22 -> + Lamdera.Wire3.succeedDecode + V023 + + 23 -> + Lamdera.Wire3.succeedDecode + V024 + + 24 -> + Lamdera.Wire3.succeedDecode + V025 + + 25 -> + Lamdera.Wire3.succeedDecode + V026 + + 26 -> + Lamdera.Wire3.succeedDecode + V027 + + 27 -> + Lamdera.Wire3.succeedDecode + V028 + + 28 -> + Lamdera.Wire3.succeedDecode + V029 + + 29 -> + Lamdera.Wire3.succeedDecode + V030 + + 30 -> + Lamdera.Wire3.succeedDecode + V031 + + 31 -> + Lamdera.Wire3.succeedDecode + V032 + + 32 -> + Lamdera.Wire3.succeedDecode + V033 + + 33 -> + Lamdera.Wire3.succeedDecode + V034 + + 34 -> + Lamdera.Wire3.succeedDecode + V035 + + 35 -> + Lamdera.Wire3.succeedDecode + V036 + + 36 -> + Lamdera.Wire3.succeedDecode + V037 + + 37 -> + Lamdera.Wire3.succeedDecode + V038 + + 38 -> + Lamdera.Wire3.succeedDecode + V039 + + 39 -> + Lamdera.Wire3.succeedDecode + V040 + + 40 -> + Lamdera.Wire3.succeedDecode + V041 + + 41 -> + Lamdera.Wire3.succeedDecode + V042 + + 42 -> + Lamdera.Wire3.succeedDecode + V043 + + 43 -> + Lamdera.Wire3.succeedDecode + V044 + + 44 -> + Lamdera.Wire3.succeedDecode + V045 + + 45 -> + Lamdera.Wire3.succeedDecode + V046 + + 46 -> + Lamdera.Wire3.succeedDecode + V047 + + 47 -> + Lamdera.Wire3.succeedDecode + V048 + + 48 -> + Lamdera.Wire3.succeedDecode + V049 + + 49 -> + Lamdera.Wire3.succeedDecode + V050 + + 50 -> + Lamdera.Wire3.succeedDecode + V051 + + 51 -> + Lamdera.Wire3.succeedDecode + V052 + + 52 -> + Lamdera.Wire3.succeedDecode + V053 + + 53 -> + Lamdera.Wire3.succeedDecode + V054 + + 54 -> + Lamdera.Wire3.succeedDecode + V055 + + 55 -> + Lamdera.Wire3.succeedDecode + V056 + + 56 -> + Lamdera.Wire3.succeedDecode + V057 + + 57 -> + Lamdera.Wire3.succeedDecode + V058 + + 58 -> + Lamdera.Wire3.succeedDecode + V059 + + 59 -> + Lamdera.Wire3.succeedDecode + V060 + + 60 -> + Lamdera.Wire3.succeedDecode + V061 + + 61 -> + Lamdera.Wire3.succeedDecode + V062 + + 62 -> + Lamdera.Wire3.succeedDecode + V063 + + 63 -> + Lamdera.Wire3.succeedDecode + V064 + + 64 -> + Lamdera.Wire3.succeedDecode + V065 + + 65 -> + Lamdera.Wire3.succeedDecode + V066 + + 66 -> + Lamdera.Wire3.succeedDecode + V067 + + 67 -> + Lamdera.Wire3.succeedDecode + V068 + + 68 -> + Lamdera.Wire3.succeedDecode + V069 + + 69 -> + Lamdera.Wire3.succeedDecode + V070 + + 70 -> + Lamdera.Wire3.succeedDecode + V071 + + 71 -> + Lamdera.Wire3.succeedDecode + V072 + + 72 -> + Lamdera.Wire3.succeedDecode + V073 + + 73 -> + Lamdera.Wire3.succeedDecode + V074 + + 74 -> + Lamdera.Wire3.succeedDecode + V075 + + 75 -> + Lamdera.Wire3.succeedDecode + V076 + + 76 -> + Lamdera.Wire3.succeedDecode + V077 + + 77 -> + Lamdera.Wire3.succeedDecode + V078 + + 78 -> + Lamdera.Wire3.succeedDecode + V079 + + 79 -> + Lamdera.Wire3.succeedDecode + V080 + + 80 -> + Lamdera.Wire3.succeedDecode + V081 + + 81 -> + Lamdera.Wire3.succeedDecode + V082 + + 82 -> + Lamdera.Wire3.succeedDecode + V083 + + 83 -> + Lamdera.Wire3.succeedDecode + V084 + + 84 -> + Lamdera.Wire3.succeedDecode + V085 + + 85 -> + Lamdera.Wire3.succeedDecode + V086 + + 86 -> + Lamdera.Wire3.succeedDecode + V087 + + 87 -> + Lamdera.Wire3.succeedDecode + V088 + + 88 -> + Lamdera.Wire3.succeedDecode + V089 + + 89 -> + Lamdera.Wire3.succeedDecode + V090 + + 90 -> + Lamdera.Wire3.succeedDecode + V091 + + 91 -> + Lamdera.Wire3.succeedDecode + V092 + + 92 -> + Lamdera.Wire3.succeedDecode + V093 + + 93 -> + Lamdera.Wire3.succeedDecode + V094 + + 94 -> + Lamdera.Wire3.succeedDecode + V095 + + 95 -> + Lamdera.Wire3.succeedDecode + V096 + + 96 -> + Lamdera.Wire3.succeedDecode + V097 + + 97 -> + Lamdera.Wire3.succeedDecode + V098 + + 98 -> + Lamdera.Wire3.succeedDecode + V099 + + 99 -> + Lamdera.Wire3.succeedDecode + V100 + + 100 -> + Lamdera.Wire3.succeedDecode + V101 + + 101 -> + Lamdera.Wire3.succeedDecode + V102 + + 102 -> + Lamdera.Wire3.succeedDecode + V103 + + 103 -> + Lamdera.Wire3.succeedDecode + V104 + + 104 -> + Lamdera.Wire3.succeedDecode + V105 + + 105 -> + Lamdera.Wire3.succeedDecode + V106 + + 106 -> + Lamdera.Wire3.succeedDecode + V107 + + 107 -> + Lamdera.Wire3.succeedDecode + V108 + + 108 -> + Lamdera.Wire3.succeedDecode + V109 + + 109 -> + Lamdera.Wire3.succeedDecode + V110 + + 110 -> + Lamdera.Wire3.succeedDecode + V111 + + 111 -> + Lamdera.Wire3.succeedDecode + V112 + + 112 -> + Lamdera.Wire3.succeedDecode + V113 + + 113 -> + Lamdera.Wire3.succeedDecode + V114 + + 114 -> + Lamdera.Wire3.succeedDecode + V115 + + 115 -> + Lamdera.Wire3.succeedDecode + V116 + + 116 -> + Lamdera.Wire3.succeedDecode + V117 + + 117 -> + Lamdera.Wire3.succeedDecode + V118 + + 118 -> + Lamdera.Wire3.succeedDecode + V119 + + 119 -> + Lamdera.Wire3.succeedDecode + V120 + + 120 -> + Lamdera.Wire3.succeedDecode + V121 + + 121 -> + Lamdera.Wire3.succeedDecode + V122 + + 122 -> + Lamdera.Wire3.succeedDecode + V123 + + 123 -> + Lamdera.Wire3.succeedDecode + V124 + + 124 -> + Lamdera.Wire3.succeedDecode + V125 + + 125 -> + Lamdera.Wire3.succeedDecode + V126 + + 126 -> + Lamdera.Wire3.succeedDecode + V127 + + 127 -> + Lamdera.Wire3.succeedDecode + V128 + + 128 -> + Lamdera.Wire3.succeedDecode + V129 + + 129 -> + Lamdera.Wire3.succeedDecode + V130 + + 130 -> + Lamdera.Wire3.succeedDecode + V131 + + 131 -> + Lamdera.Wire3.succeedDecode + V132 + + 132 -> + Lamdera.Wire3.succeedDecode + V133 + + 133 -> + Lamdera.Wire3.succeedDecode + V134 + + 134 -> + Lamdera.Wire3.succeedDecode + V135 + + 135 -> + Lamdera.Wire3.succeedDecode + V136 + + 136 -> + Lamdera.Wire3.succeedDecode + V137 + + 137 -> + Lamdera.Wire3.succeedDecode + V138 + + 138 -> + Lamdera.Wire3.succeedDecode + V139 + + 139 -> + Lamdera.Wire3.succeedDecode + V140 + + 140 -> + Lamdera.Wire3.succeedDecode + V141 + + 141 -> + Lamdera.Wire3.succeedDecode + V142 + + 142 -> + Lamdera.Wire3.succeedDecode + V143 + + 143 -> + Lamdera.Wire3.succeedDecode + V144 + + 144 -> + Lamdera.Wire3.succeedDecode + V145 + + 145 -> + Lamdera.Wire3.succeedDecode + V146 + + 146 -> + Lamdera.Wire3.succeedDecode + V147 + + 147 -> + Lamdera.Wire3.succeedDecode + V148 + + 148 -> + Lamdera.Wire3.succeedDecode + V149 + + 149 -> + Lamdera.Wire3.succeedDecode + V150 + + 150 -> + Lamdera.Wire3.succeedDecode + V151 + + 151 -> + Lamdera.Wire3.succeedDecode + V152 + + 152 -> + Lamdera.Wire3.succeedDecode + V153 + + 153 -> + Lamdera.Wire3.succeedDecode + V154 + + 154 -> + Lamdera.Wire3.succeedDecode + V155 + + 155 -> + Lamdera.Wire3.succeedDecode + V156 + + 156 -> + Lamdera.Wire3.succeedDecode + V157 + + 157 -> + Lamdera.Wire3.succeedDecode + V158 + + 158 -> + Lamdera.Wire3.succeedDecode + V159 + + 159 -> + Lamdera.Wire3.succeedDecode + V160 + + 160 -> + Lamdera.Wire3.succeedDecode + V161 + + 161 -> + Lamdera.Wire3.succeedDecode + V162 + + 162 -> + Lamdera.Wire3.succeedDecode + V163 + + 163 -> + Lamdera.Wire3.succeedDecode + V164 + + 164 -> + Lamdera.Wire3.succeedDecode + V165 + + 165 -> + Lamdera.Wire3.succeedDecode + V166 + + 166 -> + Lamdera.Wire3.succeedDecode + V167 + + 167 -> + Lamdera.Wire3.succeedDecode + V168 + + 168 -> + Lamdera.Wire3.succeedDecode + V169 + + 169 -> + Lamdera.Wire3.succeedDecode + V170 + + 170 -> + Lamdera.Wire3.succeedDecode + V171 + + 171 -> + Lamdera.Wire3.succeedDecode + V172 + + 172 -> + Lamdera.Wire3.succeedDecode + V173 + + 173 -> + Lamdera.Wire3.succeedDecode + V174 + + 174 -> + Lamdera.Wire3.succeedDecode + V175 + + 175 -> + Lamdera.Wire3.succeedDecode + V176 + + 176 -> + Lamdera.Wire3.succeedDecode + V177 + + 177 -> + Lamdera.Wire3.succeedDecode + V178 + + 178 -> + Lamdera.Wire3.succeedDecode + V179 + + 179 -> + Lamdera.Wire3.succeedDecode + V180 + + 180 -> + Lamdera.Wire3.succeedDecode + V181 + + 181 -> + Lamdera.Wire3.succeedDecode + V182 + + 182 -> + Lamdera.Wire3.succeedDecode + V183 + + 183 -> + Lamdera.Wire3.succeedDecode + V184 + + 184 -> + Lamdera.Wire3.succeedDecode + V185 + + 185 -> + Lamdera.Wire3.succeedDecode + V186 + + 186 -> + Lamdera.Wire3.succeedDecode + V187 + + 187 -> + Lamdera.Wire3.succeedDecode + V188 + + 188 -> + Lamdera.Wire3.succeedDecode + V189 + + 189 -> + Lamdera.Wire3.succeedDecode + V190 + + 190 -> + Lamdera.Wire3.succeedDecode + V191 + + 191 -> + Lamdera.Wire3.succeedDecode + V192 + + 192 -> + Lamdera.Wire3.succeedDecode + V193 + + 193 -> + Lamdera.Wire3.succeedDecode + V194 + + 194 -> + Lamdera.Wire3.succeedDecode + V195 + + 195 -> + Lamdera.Wire3.succeedDecode + V196 + + 196 -> + Lamdera.Wire3.succeedDecode + V197 + + 197 -> + Lamdera.Wire3.succeedDecode + V198 + + 198 -> + Lamdera.Wire3.succeedDecode + V199 + + 199 -> + Lamdera.Wire3.succeedDecode + V200 + + 200 -> + Lamdera.Wire3.succeedDecode + V201 + + 201 -> + Lamdera.Wire3.succeedDecode + V202 + + 202 -> + Lamdera.Wire3.succeedDecode + V203 + + 203 -> + Lamdera.Wire3.succeedDecode + V204 + + 204 -> + Lamdera.Wire3.succeedDecode + V205 + + 205 -> + Lamdera.Wire3.succeedDecode + V206 + + 206 -> + Lamdera.Wire3.succeedDecode + V207 + + 207 -> + Lamdera.Wire3.succeedDecode + V208 + + 208 -> + Lamdera.Wire3.succeedDecode + V209 + + 209 -> + Lamdera.Wire3.succeedDecode + V210 + + 210 -> + Lamdera.Wire3.succeedDecode + V211 + + 211 -> + Lamdera.Wire3.succeedDecode + V212 + + 212 -> + Lamdera.Wire3.succeedDecode + V213 + + 213 -> + Lamdera.Wire3.succeedDecode + V214 + + 214 -> + Lamdera.Wire3.succeedDecode + V215 + + 215 -> + Lamdera.Wire3.succeedDecode + V216 + + 216 -> + Lamdera.Wire3.succeedDecode + V217 + + 217 -> + Lamdera.Wire3.succeedDecode + V218 + + 218 -> + Lamdera.Wire3.succeedDecode + V219 + + 219 -> + Lamdera.Wire3.succeedDecode + V220 + + 220 -> + Lamdera.Wire3.succeedDecode + V221 + + 221 -> + Lamdera.Wire3.succeedDecode + V222 + + 222 -> + Lamdera.Wire3.succeedDecode + V223 + + 223 -> + Lamdera.Wire3.succeedDecode + V224 + + 224 -> + Lamdera.Wire3.succeedDecode + V225 + + 225 -> + Lamdera.Wire3.succeedDecode + V226 + + 226 -> + Lamdera.Wire3.succeedDecode + V227 + + 227 -> + Lamdera.Wire3.succeedDecode + V228 + + 228 -> + Lamdera.Wire3.succeedDecode + V229 + + 229 -> + Lamdera.Wire3.succeedDecode + V230 + + 230 -> + Lamdera.Wire3.succeedDecode + V231 + + 231 -> + Lamdera.Wire3.succeedDecode + V232 + + 232 -> + Lamdera.Wire3.succeedDecode + V233 + + 233 -> + Lamdera.Wire3.succeedDecode + V234 + + 234 -> + Lamdera.Wire3.succeedDecode + V235 + + 235 -> + Lamdera.Wire3.succeedDecode + V236 + + 236 -> + Lamdera.Wire3.succeedDecode + V237 + + 237 -> + Lamdera.Wire3.succeedDecode + V238 + + 238 -> + Lamdera.Wire3.succeedDecode + V239 + + 239 -> + Lamdera.Wire3.succeedDecode + V240 + + 240 -> + Lamdera.Wire3.succeedDecode + V241 + + 241 -> + Lamdera.Wire3.succeedDecode + V242 + + 242 -> + Lamdera.Wire3.succeedDecode + V243 + + 243 -> + Lamdera.Wire3.succeedDecode + V244 + + 244 -> + Lamdera.Wire3.succeedDecode + V245 + + 245 -> + Lamdera.Wire3.succeedDecode + V246 + + 246 -> + Lamdera.Wire3.succeedDecode + V247 + + 247 -> + Lamdera.Wire3.succeedDecode + V248 + + 248 -> + Lamdera.Wire3.succeedDecode + V249 + + 249 -> + Lamdera.Wire3.succeedDecode + V250 + + 250 -> + Lamdera.Wire3.succeedDecode + V251 + + 251 -> + Lamdera.Wire3.succeedDecode + V252 + + 252 -> + Lamdera.Wire3.succeedDecode + V253 + + 253 -> + Lamdera.Wire3.succeedDecode + V254 + + 254 -> + Lamdera.Wire3.succeedDecode + V255 + + 255 -> + Lamdera.Wire3.succeedDecode + V256 + + 256 -> + Lamdera.Wire3.succeedDecode + V257 + + _ -> + Lamdera.Wire3.failDecode + )