diff --git a/gibbon-compiler/.gitignore b/gibbon-compiler/.gitignore index 02f2565fa..b30392163 100644 --- a/gibbon-compiler/.gitignore +++ b/gibbon-compiler/.gitignore @@ -32,3 +32,4 @@ demo/*.c demo/*.exe gibbon-compiler/examples/parallel/data/*.txt *.log.hs +*.log diff --git a/gibbon-compiler/IR.log b/gibbon-compiler/IR.log deleted file mode 100644 index 359ac2ee4..000000000 --- a/gibbon-compiler/IR.log +++ /dev/null @@ -1,3 +0,0 @@ - ! Responding to env Var: GIBBON_DEBUG=4 - ! We set DEBUG based on command-line verbose arg: 4 -gibbon: /home/timmy/git/gibbon/gibbon-compiler/./examples/addone.hs: openFile: does not exist (No such file or directory) diff --git a/gibbon-compiler/examples/layout_bench/Basics.hs b/gibbon-compiler/examples/layout_bench/Basics.hs index 6c5926bf8..e74bb0d11 100644 --- a/gibbon-compiler/examples/layout_bench/Basics.hs +++ b/gibbon-compiler/examples/layout_bench/Basics.hs @@ -588,6 +588,8 @@ printID id = case id of printBlog :: Blog -> () printBlog blog = case blog of + End -> let _ = printsym (quote "Fin") + in () Layout1 header id author date content tags rst -> let _ = printsym (quote "Layout1 ") _ = printHeader header _ = printID id @@ -597,6 +599,24 @@ printBlog blog = case blog of _ = printTagList tags _ = printBlog rst in () + Layout2 content tags rst header id author date -> let _ = printsym (quote "Layout2 ") + _ = printHeader header + _ = printID id + _ = printAuthor author + _ = printDate date + _ = printContent content + _ = printTagList tags + _ = printBlog rst + in () + Layout4 tags content rst header id author date -> let _ = printsym (quote "Layout4 ") + _ = printHeader header + _ = printID id + _ = printAuthor author + _ = printDate date + _ = printContent content + _ = printTagList tags + _ = printBlog rst + in () diff --git a/gibbon-compiler/examples/layout_bench/ir.log b/gibbon-compiler/examples/layout_bench/ir.log new file mode 100644 index 000000000..d044071d4 --- /dev/null +++ b/gibbon-compiler/examples/layout_bench/ir.log @@ -0,0 +1,4150 @@ + ! Responding to env Var: GIBBON_DEBUG=4 + ! We set DEBUG based on command-line verbose arg: 4 + +Parsed: +================================================================================ +ProgBundle [ProgModule "GenerateLayout1" + (Prog + {ddefs = [], + fundefs = [(mkBlogs_layout1, + FunDef {funName = "mkBlogs_layout1", + funArgs = [length], + funTy = ForAll [] + (ArrowTy [IntTy] + (PackedTy "Blog" [])), + funBody = IfE (PrimAppE LtEqP + [VarE "length",LitE 0]) + (DataConE (MetaTv $1) "End" []) + (LetE (header, + [], + MetaTv $16, + DataConE (MetaTv $15) + "Header" + [AppE "getRandomString" + [] + [LitE 5]]) + (LetE (id, + [], + MetaTv $14, + DataConE (MetaTv $13) + "ID" + [PrimAppE SubP + [LitE 10, + PrimAppE ModP + [VarE "length", + LitE 10]]]) + (LetE (author, + [], + MetaTv $12, + DataConE (MetaTv $11) + "Author" + [AppE "getRandomString" + [] + [LitE 5]]) + (LetE (date, + [], + MetaTv $10, + DataConE (MetaTv $9) + "Date" + [AppE "getRandomString" + [] + [LitE 5]]) + (LetE (content, + [], + MetaTv $8, + DataConE (MetaTv $6) + "Content" + [DataConE (MetaTv $7) + "Plain" + [AppE "mkRandomInlineList" + [] + [LitE 50]]]) + (LetE (tags, + [], + MetaTv $5, + DataConE (MetaTv $4) + "TagList" + [AppE "mkSomeTags" + [] + [LitE 10]]) + (LetE (rst, + [], + MetaTv $3, + AppE "mkBlogs_layout1" + [] + [PrimAppE SubP + [VarE "length", + LitE 1]]) + (DataConE (MetaTv $2) + "Layout1" + [VarE "header", + VarE "id", + VarE "author", + VarE "date", + VarE "content", + VarE "tags", + VarE "rst"])))))))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}})], + mainExp = Nothing}) + [ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 3 1 3 14, srcInfoPoints = [SrcSpan ".hs" 3 1 3 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 3 8 3 14, srcInfoPoints = []}) "Basics", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}], + ProgModule "Gibbon.Vector" + (Prog + {ddefs = [], + fundefs = [(generate, + FunDef {funName = "generate", + funArgs = [n,f], + funTy = ForAll [u:a] + (ArrowTy [IntTy, + ArrowTy [IntTy] + (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = LetE (n', + [], + MetaTv $91, + AppE "maxInt" [] [VarE "n",LitE 0]) + (LetE (vec, + [], + VectorTy (TyVar u:a), + PrimAppE (VAllocP (MetaTv $90)) + [VarE "n'"]) + (LetE (vec1, + [], + MetaTv $89, + AppE "generate_loop" + [] + [VarE "vec", + LitE 0,VarE "n'", + VarE "f"]) + (VarE "vec1"))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (length, + FunDef {funName = "length", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + IntTy), + funBody = PrimAppE (VLengthP (MetaTv $3)) + [VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (select, + FunDef {funName = "select", + funArgs = [v1,v2,i], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + VectorTy (TyVar u:a), + IntTy] + (TyVar u:a)), + funBody = LetE (len, + [], + MetaTv $102, + PrimAppE (VLengthP (MetaTv $101)) + [VarE "v1"]) + (IfE (PrimAppE LtP + [VarE "i", + VarE "len"]) + (PrimAppE (VNthP (MetaTv $99)) + [VarE "v1",VarE "i"]) + (PrimAppE (VNthP (MetaTv $100)) + [VarE "v2", + PrimAppE SubP + [VarE "i", + VarE "len"]])), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (nth, + FunDef {funName = "nth", + funArgs = [vec,i], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + IntTy] + (TyVar u:a)), + funBody = PrimAppE (VNthP (MetaTv $15)) + [VarE "vec",VarE "i"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (singleton, + FunDef {funName = "singleton", + funArgs = [x], + funTy = ForAll [u:a] + (ArrowTy [TyVar u:a] + (VectorTy (TyVar u:a))), + funBody = LetE (vec, + [], + VectorTy (TyVar u:a), + PrimAppE (VAllocP (MetaTv $55)) + [LitE 1]) + (LetE (vec2, + [], + MetaTv $54, + PrimAppE (InplaceVUpdateP (MetaTv $53)) + [VarE "vec",LitE 0, + VarE "x"]) + (VarE "vec2")), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (append, + FunDef {funName = "append", + funArgs = [v1,v2], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = AppE "generate" + [] + [PrimAppE AddP + [PrimAppE (VLengthP (MetaTv $105)) + [VarE "v1"], + PrimAppE (VLengthP (MetaTv $106)) + [VarE "v2"]], + Ext (LambdaE [(i, MetaTv $107)] + (AppE "select" + [] + [VarE "v1", + VarE "v2", + VarE "i"]))], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (head, + FunDef {funName = "head", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + (TyVar u:a)), + funBody = AppE "nth" [] [VarE "vec",LitE 0], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printVec, + FunDef {funName = "printVec", + funArgs = [f,vec], + funTy = ForAll [u:a] + (ArrowTy [ArrowTy [TyVar u:a] + (ProdTy []), + VectorTy (TyVar u:a)] + (ProdTy [])), + funBody = LetE (wildcard_178, + [], + MetaTv $179, + PrimAppE PrintSym [LitSymE "["]) + (LetE (wildcard_176, + [], + MetaTv $177, + AppE "printVec_loop" + [] + [LitE 0, + PrimAppE (VLengthP (MetaTv $175)) + [VarE "vec"], + VarE "vec",VarE "f"]) + (LetE (wildcard_173, + [], + MetaTv $174, + PrimAppE PrintSym + [LitSymE "]"]) + (MkProdE []))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (alloc, + FunDef {funName = "alloc", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [IntTy] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (VAllocP (MetaTv $1)) + [VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (filter, + FunDef {funName = "filter", + funArgs = [f,vec], + funTy = ForAll [u:a] + (ArrowTy [ArrowTy [TyVar u:a] + BoolTy, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = LetE (idxs, + [], + VectorTy IntTy, + AppE "generate" + [] + [PrimAppE (VLengthP (MetaTv $231)) + [VarE "vec"], + Ext (LambdaE [(i, + MetaTv $232)] + (IfE (AppE "f" + [] + [AppE "nth" + [] + [VarE "vec", + VarE "i"]]) + (VarE "i") + (PrimAppE SubP + [LitE 0, + LitE 1])))]) + (LetE (num_ones, + [], + MetaTv $230, + AppE "foldl" + [] + [Ext (LambdaE [(acc, + IntTy), + (x, + IntTy)] + (IfE (PrimAppE EqIntP + [VarE "x", + PrimAppE SubP + [LitE 0, + LitE 1]]) + (VarE "acc") + (PrimAppE AddP + [VarE "acc", + LitE 1]))), + LitE 0,VarE "idxs"]) + (LetE (to, + [], + VectorTy (TyVar u:a), + PrimAppE (VAllocP (MetaTv $227)) + [VarE "num_ones"]) + (LetE (len_idxs, + [], + MetaTv $226, + PrimAppE (VLengthP (MetaTv $225)) + [VarE "idxs"]) + (AppE "filter_loop" + [] + [VarE "idxs", + LitE 0, + LitE 0, + VarE "len_idxs", + VarE "vec", + VarE "to"])))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (filter_loop, + FunDef {funName = "filter_loop", + funArgs = [idxs,write_at,start,end,from,to], + funTy = ForAll [u:a] + (ArrowTy [VectorTy IntTy,IntTy, + IntTy,IntTy, + VectorTy (TyVar u:a), + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = IfE (PrimAppE EqIntP + [VarE "start",VarE "end"]) + (VarE "to") + (LetE (idx, + [], + MetaTv $222, + AppE "nth" + [] + [VarE "idxs", + VarE "start"]) + (IfE (PrimAppE EqIntP + [VarE "idx", + PrimAppE SubP + [LitE 0, + LitE 1]]) + (AppE "filter_loop" + [] + [VarE "idxs", + VarE "write_at", + PrimAppE AddP + [VarE "start", + LitE 1], + VarE "end", + VarE "from", + VarE "to"]) + (LetE (elt, + [], + MetaTv $221, + AppE "nth" + [] + [VarE "from", + VarE "idx"]) + (LetE (to1, + [], + MetaTv $220, + PrimAppE (InplaceVUpdateP (MetaTv $219)) + [VarE "to", + VarE "write_at", + VarE "elt"]) + (AppE "filter_loop" + [] + [VarE "idxs", + PrimAppE AddP + [VarE "write_at", + LitE 1], + PrimAppE AddP + [VarE "start", + LitE 1], + VarE "end", + VarE "from", + VarE "to1"]))))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lcons, + FunDef {funName = "lcons", + funArgs = [x,vec], + funTy = ForAll [u:a] + (ArrowTy [TyVar u:a, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = LetE (y, [], MetaTv $212, VarE "vec") + (AppE "cons" + [] + [VarE "x",VarE "y"]), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (cons, + FunDef {funName = "cons", + funArgs = [x,vec], + funTy = ForAll [u:a] + (ArrowTy [TyVar u:a, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = LetE (len, + [], + MetaTv $209, + PrimAppE (VLengthP (MetaTv $208)) + [VarE "vec"]) + (LetE (vec2, + [], + VectorTy (TyVar u:a), + PrimAppE (VAllocP (MetaTv $207)) + [PrimAppE AddP + [VarE "len", + LitE 1]]) + (LetE (vec3, + [], + MetaTv $206, + AppE "generate_loop" + [] + [VarE "vec2", + LitE 1, + PrimAppE AddP + [VarE "len", + LitE 1], + Ext (LambdaE [(i, + MetaTv $205)] + (AppE "nth" + [] + [VarE "vec", + PrimAppE SubP + [VarE "i", + LitE 1]]))]) + (LetE (vec4, + [], + MetaTv $204, + PrimAppE (InplaceVUpdateP (MetaTv $203)) + [VarE "vec3", + LitE 0, + VarE "x"]) + (VarE "vec4")))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lsnoc, + FunDef {funName = "lsnoc", + funArgs = [vec,x], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + TyVar u:a] + (VectorTy (TyVar u:a))), + funBody = LetE (y, [], MetaTv $200, VarE "vec") + (AppE "snoc" + [] + [VarE "y",VarE "x"]), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (snoc, + FunDef {funName = "snoc", + funArgs = [vec,x], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + TyVar u:a] + (VectorTy (TyVar u:a))), + funBody = LetE (len, + [], + MetaTv $197, + PrimAppE (VLengthP (MetaTv $196)) + [VarE "vec"]) + (LetE (vec2, + [], + VectorTy (TyVar u:a), + PrimAppE (VAllocP (MetaTv $195)) + [PrimAppE AddP + [VarE "len", + LitE 1]]) + (LetE (vec3, + [], + MetaTv $194, + AppE "generate_loop" + [] + [VarE "vec2", + LitE 0, + VarE "len", + Ext (LambdaE [(i, + MetaTv $193)] + (AppE "nth" + [] + [VarE "vec", + VarE "i"]))]) + (LetE (vec4, + [], + MetaTv $192, + PrimAppE (InplaceVUpdateP (MetaTv $191)) + [VarE "vec3", + VarE "len", + VarE "x"]) + (VarE "vec4")))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printVec_loop, + FunDef {funName = "printVec_loop", + funArgs = [idx,end,vec,f], + funTy = ForAll [u:a] + (ArrowTy [IntTy,IntTy, + VectorTy (TyVar u:a), + ArrowTy [TyVar u:a] + (ProdTy [])] + (ProdTy [])), + funBody = IfE (PrimAppE EqIntP + [VarE "idx",VarE "end"]) + (MkProdE []) + (LetE (wildcard_187, + [], + MetaTv $188, + AppE "f" + [] + [PrimAppE (VNthP (MetaTv $186)) + [VarE "vec", + VarE "idx"]]) + (LetE (wildcard_184, + [], + MetaTv $185, + PrimAppE PrintSym + [LitSymE ","]) + (AppE "printVec_loop" + [] + [PrimAppE AddP + [VarE "idx", + LitE 1], + VarE "end", + VarE "vec", + VarE "f"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lifoldl, + FunDef {funName = "lifoldl", + funArgs = [f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:b,IntTy, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (TyVar u:b)), + funBody = LetE (x, [], MetaTv $170, VarE "vec") + (AppE "ifoldl" + [] + [VarE "f",VarE "acc", + VarE "x"]), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (ifoldl_loop, + FunDef {funName = "ifoldl_loop", + funArgs = [idx,end,f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [IntTy,IntTy, + ArrowTy [TyVar u:b,IntTy, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (TyVar u:b)), + funBody = IfE (PrimAppE EqIntP + [VarE "idx",VarE "end"]) + (VarE "acc") + (LetE (acc1, + [], + MetaTv $166, + AppE "f" + [] + [VarE "acc",VarE "idx", + PrimAppE (VNthP (MetaTv $165)) + [VarE "vec", + VarE "idx"]]) + (AppE "ifoldl_loop" + [] + [PrimAppE AddP + [VarE "idx", + LitE 1], + VarE "end",VarE "f", + VarE "acc1", + VarE "vec"])), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (ifoldl, + FunDef {funName = "ifoldl", + funArgs = [f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:b,IntTy, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (TyVar u:b)), + funBody = AppE "ifoldl_loop" + [] + [LitE 0, + PrimAppE (VLengthP (MetaTv $159)) + [VarE "vec"], + VarE "f",VarE "acc",VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lscanl, + FunDef {funName = "lscanl", + funArgs = [f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:b, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:b))), + funBody = LetE (x, [], MetaTv $155, VarE "vec") + (AppE "scanl" + [] + [VarE "f",VarE "acc", + VarE "x"]), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (scanl_loop, + FunDef {funName = "scanl_loop", + funArgs = [idx,end,f,acc,vec,result], + funTy = ForAll [u:a,u:b] + (ArrowTy [IntTy,IntTy, + ArrowTy [TyVar u:b, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a), + VectorTy (TyVar u:b)] + (VectorTy (TyVar u:b))), + funBody = IfE (PrimAppE EqIntP + [VarE "idx",VarE "end"]) + (VarE "result") + (LetE (acc1, + [], + MetaTv $151, + AppE "f" + [] + [VarE "acc", + PrimAppE (VNthP (MetaTv $150)) + [VarE "vec", + VarE "idx"]]) + (LetE (result', + [], + MetaTv $149, + PrimAppE (InplaceVUpdateP (MetaTv $148)) + [VarE "result", + VarE "idx", + VarE "acc1"]) + (AppE "scanl_loop" + [] + [PrimAppE AddP + [VarE "idx", + LitE 1], + VarE "end", + VarE "f", + VarE "acc1", + VarE "vec", + VarE "result'"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (scanl, + FunDef {funName = "scanl", + funArgs = [f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:b, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:b))), + funBody = LetE (len, + [], + MetaTv $141, + PrimAppE (VLengthP (MetaTv $140)) + [VarE "vec"]) + (LetE (result, + [], + VectorTy (TyVar u:b), + PrimAppE (VAllocP (MetaTv $139)) + [VarE "len"]) + (AppE "scanl_loop" + [] + [LitE 0,VarE "len", + VarE "f",VarE "acc", + VarE "vec", + VarE "result"])), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lfoldl, + FunDef {funName = "lfoldl", + funArgs = [f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:b, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (TyVar u:b)), + funBody = LetE (x, [], MetaTv $135, VarE "vec") + (AppE "foldl" + [] + [VarE "f",VarE "acc", + VarE "x"]), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (foldl_loop, + FunDef {funName = "foldl_loop", + funArgs = [idx,end,f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [IntTy,IntTy, + ArrowTy [TyVar u:b, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (TyVar u:b)), + funBody = IfE (PrimAppE EqIntP + [VarE "idx",VarE "end"]) + (VarE "acc") + (LetE (acc1, + [], + MetaTv $131, + AppE "f" + [] + [VarE "acc", + PrimAppE (VNthP (MetaTv $130)) + [VarE "vec", + VarE "idx"]]) + (AppE "foldl_loop" + [] + [PrimAppE AddP + [VarE "idx", + LitE 1], + VarE "end",VarE "f", + VarE "acc1", + VarE "vec"])), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (foldl, + FunDef {funName = "foldl", + funArgs = [f,acc,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:b, + TyVar u:a] + (TyVar u:b), + TyVar u:b, + VectorTy (TyVar u:a)] + (TyVar u:b)), + funBody = AppE "foldl_loop" + [] + [LitE 0, + PrimAppE (VLengthP (MetaTv $124)) + [VarE "vec"], + VarE "f",VarE "acc",VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (update, + FunDef {funName = "update", + funArgs = [vec,i,x], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + IntTy,TyVar u:a] + (VectorTy (TyVar u:a))), + funBody = AppE "generate" + [] + [AppE "length" [] [VarE "vec"], + Ext (LambdaE [(j, MetaTv $120)] + (IfE (PrimAppE EqIntP + [VarE "i", + VarE "j"]) + (VarE "x") + (PrimAppE (VNthP (MetaTv $119)) + [VarE "vec", + VarE "j"])))], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lmap, + FunDef {funName = "lmap", + funArgs = [f,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:a] + (TyVar u:b), + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:b))), + funBody = LetE (x, [], MetaTv $115, VarE "vec") + (AppE "map" [] [VarE "f",VarE "x"]), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (map, + FunDef {funName = "map", + funArgs = [f,vec], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:a] + (TyVar u:b), + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:b))), + funBody = AppE "generate" + [] + [PrimAppE (VLengthP (MetaTv $110)) + [VarE "vec"], + Ext (LambdaE [(i, MetaTv $112)] + (AppE "f" + [] + [PrimAppE (VNthP (MetaTv $111)) + [VarE "vec", + VarE "i"]]))], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lcopy, + FunDef {funName = "lcopy", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = AppE "copy" [] [VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (copy, + FunDef {funName = "copy", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = AppE "generate" + [] + [PrimAppE (VLengthP (MetaTv $93)) + [VarE "vec"], + Ext (LambdaE [(i, MetaTv $94)] + (AppE "nth" + [] + [VarE "vec", + VarE "i"]))], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (generate_loop, + FunDef {funName = "generate_loop", + funArgs = [vec,idx,end,f], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + IntTy,IntTy, + ArrowTy [IntTy] + (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = IfE (PrimAppE EqIntP + [VarE "idx",VarE "end"]) + (VarE "vec") + (LetE (vec1, + [], + MetaTv $86, + PrimAppE (InplaceVUpdateP (MetaTv $85)) + [VarE "vec", + VarE "idx", + AppE "f" + [] + [VarE "idx"]]) + (AppE "generate_loop" + [] + [VarE "vec1", + PrimAppE AddP + [VarE "idx", + LitE 1], + VarE "end",VarE "f"])), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (tail, + FunDef {funName = "tail", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = AppE "slice" + [] + [LitE 1, + PrimAppE SubP + [PrimAppE (VLengthP (MetaTv $80)) + [VarE "vec"], + LitE 1], + VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lsplitAt', + FunDef {funName = "lsplitAt'", + funArgs = [n,vec], + funTy = ForAll [u:a] + (ArrowTy [IntTy, + VectorTy (TyVar u:a)] + (ProdTy [IntTy, + VectorTy (TyVar u:a), + IntTy, + VectorTy (TyVar u:a)])), + funBody = LetE (tup74, + [], + MetaTv $75, + AppE "splitAt" + [] + [VarE "n",VarE "vec"]) + (LetE (x, + [], + MetaTv $77, + ProjE 0 (VarE "tup74")) + (LetE (y, + [], + MetaTv $76, + ProjE 1 (VarE "tup74")) + (MkProdE [PrimAppE (VLengthP (MetaTv $71)) + [VarE "x"], + VarE "x", + PrimAppE (VLengthP (MetaTv $73)) + [VarE "y"], + VarE "y"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (lsplitAt, + FunDef {funName = "lsplitAt", + funArgs = [n,vec], + funTy = ForAll [u:a] + (ArrowTy [IntTy, + VectorTy (TyVar u:a)] + (ProdTy [IntTy, + VectorTy (TyVar u:a), + IntTy, + VectorTy (TyVar u:a)])), + funBody = LetE (x, [], MetaTv $67, VarE "vec") + (AppE "lsplitAt'" + [] + [VarE "n",VarE "x"]), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (splitAt, + FunDef {funName = "splitAt", + funArgs = [n,vec], + funTy = ForAll [u:a] + (ArrowTy [IntTy, + VectorTy (TyVar u:a)] + (ProdTy [VectorTy (TyVar u:a), + VectorTy (TyVar u:a)])), + funBody = LetE (len, + [], + MetaTv $64, + PrimAppE (VLengthP (MetaTv $63)) + [VarE "vec"]) + (LetE (n', + [], + MetaTv $62, + AppE "maxInt" + [] + [VarE "n",LitE 0]) + (LetE (m, + [], + MetaTv $61, + AppE "minInt" + [] + [VarE "n'", + VarE "len"]) + (LetE (m', + [], + MetaTv $60, + AppE "maxInt" + [] + [LitE 0, + PrimAppE SubP + [VarE "len", + VarE "n'"]]) + (MkProdE [PrimAppE (VSliceP (MetaTv $58)) + [LitE 0, + VarE "m", + VarE "vec"], + PrimAppE (VSliceP (MetaTv $59)) + [VarE "m", + VarE "m'", + VarE "vec"]])))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (isEmpty, + FunDef {funName = "isEmpty", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + BoolTy), + funBody = PrimAppE EqIntP + [PrimAppE (VLengthP (MetaTv $51)) + [VarE "vec"], + LitE 0], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (inplaceUpdate, + FunDef {funName = "inplaceUpdate", + funArgs = [i,val,vec], + funTy = ForAll [u:a] + (ArrowTy [IntTy,TyVar u:a, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (InplaceVUpdateP (MetaTv $49)) + [VarE "vec",VarE "i", + VarE "val"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (inplaceSort, + FunDef {funName = "inplaceSort", + funArgs = [cmp,vec], + funTy = ForAll [u:a] + (ArrowTy [ArrowTy [TyVar u:a, + TyVar u:a] + IntTy, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (InplaceVSortP (MetaTv $45)) + [VarE "vec",VarE "cmp"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (flatten, + FunDef {funName = "flatten", + funArgs = [ls], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (VectorTy (TyVar u:a))] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (VConcatP (MetaTv $42)) + [VarE "ls"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (sort, + FunDef {funName = "sort", + funArgs = [cmp,vec], + funTy = ForAll [u:a] + (ArrowTy [ArrowTy [TyVar u:a, + TyVar u:a] + IntTy, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (VSortP (MetaTv $40)) + [VarE "vec",VarE "cmp"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (merge, + FunDef {funName = "merge", + funArgs = [vec1,vec2], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (VMergeP (MetaTv $37)) + [VarE "vec1",VarE "vec2"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (unsafeSlice, + FunDef {funName = "unsafeSlice", + funArgs = [i,n,vec], + funTy = ForAll [u:a] + (ArrowTy [IntTy,IntTy, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (VSliceP (MetaTv $34)) + [VarE "i",VarE "n",VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (slice, + FunDef {funName = "slice", + funArgs = [i,n,vec], + funTy = ForAll [u:a] + (ArrowTy [IntTy,IntTy, + VectorTy (TyVar u:a)] + (VectorTy (TyVar u:a))), + funBody = PrimAppE (VSliceP (MetaTv $30)) + [VarE "i",VarE "n",VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (nth2, + FunDef {funName = "nth2", + funArgs = [vec,i], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + IntTy] + (ProdTy [TyVar u:a, + VectorTy (TyVar u:a)])), + funBody = LetE (tup26, [], MetaTv $24, VarE "vec") + (LetE (vec1, + [], + MetaTv $24, + VarE "tup26") + (LetE (vec2, + [], + MetaTv $25, + VarE "tup26") + (MkProdE [PrimAppE (VNthP (MetaTv $23)) + [VarE "vec1", + VarE "i"], + VarE "vec2"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (nth1, + FunDef {funName = "nth1", + funArgs = [vec,i], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a), + IntTy] + (TyVar u:a)), + funBody = PrimAppE (VNthP (MetaTv $19)) + [VarE "vec",VarE "i"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (length2, + FunDef {funName = "length2", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + (ProdTy [IntTy, + VectorTy (TyVar u:a)])), + funBody = LetE (tup12, [], MetaTv $10, VarE "vec") + (LetE (vec1, + [], + MetaTv $10, + VarE "tup12") + (LetE (vec2, + [], + MetaTv $11, + VarE "tup12") + (MkProdE [PrimAppE (VLengthP (MetaTv $9)) + [VarE "vec1"], + VarE "vec2"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (length1, + FunDef {funName = "length1", + funArgs = [vec], + funTy = ForAll [u:a] + (ArrowTy [VectorTy (TyVar u:a)] + IntTy), + funBody = PrimAppE (VLengthP (MetaTv $6)) + [VarE "vec"], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}})], + mainExp = Nothing}) + [ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 10 1 10 22, srcInfoPoints = [SrcSpan ".hs" 10 1 10 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 10 8 10 22, srcInfoPoints = []}) "Gibbon.Prelude", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}], + ProgModule "Gibbon.Prim" + (Prog {ddefs = [], fundefs = [], mainExp = Nothing}) + [], + ProgModule "Gibbon.Prelude" + (Prog + {ddefs = [], + fundefs = [(maxInt, + FunDef {funName = "maxInt", + funArgs = [a,b], + funTy = ForAll [] (ArrowTy [IntTy,IntTy] IntTy), + funBody = IfE (PrimAppE GtP [VarE "a",VarE "b"]) + (VarE "a") + (VarE "b"), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (print_space, + FunDef {funName = "print_space", + funArgs = [wildcard_20], + funTy = ForAll [] + (ArrowTy [ProdTy []] (ProdTy [])), + funBody = PrimAppE PrintSym [LitSymE " "], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (print_newline, + FunDef {funName = "print_newline", + funArgs = [wildcard_18], + funTy = ForAll [] + (ArrowTy [ProdTy []] (ProdTy [])), + funBody = PrimAppE PrintSym [LitSymE "\n"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (print_check, + FunDef {funName = "print_check", + funArgs = [b], + funTy = ForAll [] (ArrowTy [BoolTy] (ProdTy [])), + funBody = IfE (VarE "b") + (LetE (wildcard_14, + [], + MetaTv $15, + PrimAppE PrintSym + [LitSymE "OK\n"]) + (MkProdE [])) + (LetE (wildcard_16, + [], + MetaTv $17, + PrimAppE PrintSym + [LitSymE "Err\n"]) + (MkProdE [])), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (compare_int, + FunDef {funName = "compare_int", + funArgs = [r1,r2], + funTy = ForAll [] (ArrowTy [IntTy,IntTy] IntTy), + funBody = IfE (PrimAppE LtP [VarE "r1",VarE "r2"]) + (PrimAppE SubP [LitE 0,LitE 1]) + (IfE (PrimAppE GtP + [VarE "r1",VarE "r2"]) + (LitE 1) + (LitE 0)), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (compare_float, + FunDef {funName = "compare_float", + funArgs = [r1,r2], + funTy = ForAll [] + (ArrowTy [FloatTy,FloatTy] IntTy), + funBody = IfE (PrimAppE FLtP [VarE "r1",VarE "r2"]) + (PrimAppE SubP [LitE 0,LitE 1]) + (IfE (PrimAppE FGtP + [VarE "r1",VarE "r2"]) + (LitE 1) + (LitE 0)), + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (float_abs, + FunDef {funName = "float_abs", + funArgs = [f], + funTy = ForAll [] (ArrowTy [FloatTy] FloatTy), + funBody = IfE (PrimAppE FLtP [VarE "f",FloatE 0.0]) + (PrimAppE FMulP + [VarE "f", + PrimAppE FSubP + [FloatE 0.0, + FloatE 1.0]]) + (VarE "f"), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (minFloat, + FunDef {funName = "minFloat", + funArgs = [a,b], + funTy = ForAll [] + (ArrowTy [FloatTy,FloatTy] FloatTy), + funBody = IfE (PrimAppE FLtP [VarE "a",VarE "b"]) + (VarE "a") + (VarE "b"), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (maxFloat, + FunDef {funName = "maxFloat", + funArgs = [a,b], + funTy = ForAll [] + (ArrowTy [FloatTy,FloatTy] FloatTy), + funBody = IfE (PrimAppE FGtP [VarE "a",VarE "b"]) + (VarE "a") + (VarE "b"), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (minInt, + FunDef {funName = "minInt", + funArgs = [a,b], + funTy = ForAll [] (ArrowTy [IntTy,IntTy] IntTy), + funBody = IfE (PrimAppE LtP [VarE "a",VarE "b"]) + (VarE "a") + (VarE "b"), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}})], + mainExp = Nothing}) + [ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 12 1 12 19, srcInfoPoints = [SrcSpan ".hs" 12 1 12 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 12 8 12 19, srcInfoPoints = []}) "Gibbon.Prim", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}], + ProgModule "Gibbon.PList" + (Prog + {ddefs = [(PList, + DDef {tyName = "PList", + tyArgs = [u:a], + dataCons = [("Nil", []), + ("Cons", + [(False, TyVar u:a), + (False, + PackedTy "PList" [TyVar u:a])])]})], + fundefs = [(is_empty_plist, + FunDef {funName = "is_empty_plist", + funArgs = [ls], + funTy = ForAll [u:a] + (ArrowTy [PackedTy "PList" + [TyVar u:a]] + BoolTy), + funBody = CaseE (VarE "ls") + [("Nil", [], PrimAppE MkTrue []), + ("Cons", + [(wildcard_1, MetaTv $3), + (wildcard_2, MetaTv $4)], + PrimAppE MkFalse [])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (zip_plist, + FunDef {funName = "zip_plist", + funArgs = [as,bs], + funTy = ForAll [u:a,u:b] + (ArrowTy [PackedTy "PList" + [TyVar u:a], + PackedTy "PList" + [TyVar u:b]] + (PackedTy "PList" + [ProdTy [TyVar u:a, + TyVar u:b]])), + funBody = CaseE (VarE "as") + [("Nil", + [], + DataConE (MetaTv $71) "Nil" []), + ("Cons", + [(z, MetaTv $76), + (zs, MetaTv $77)], + CaseE (VarE "bs") + [("Nil", + [], + DataConE (MetaTv $72) + "Nil" + []), + ("Cons", + [(y, MetaTv $74), + (ys, MetaTv $75)], + DataConE (MetaTv $73) + "Cons" + [MkProdE [VarE "z", + VarE "y"], + AppE "zip_plist" + [] + [VarE "zs", + VarE "ys"]])])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (splitAt_plist, + FunDef {funName = "splitAt_plist", + funArgs = [n,a], + funTy = ForAll [u:a] + (ArrowTy [IntTy, + PackedTy "PList" + [TyVar u:a]] + (ProdTy [PackedTy "PList" + [TyVar u:a], + PackedTy "PList" + [TyVar u:a]])), + funBody = IfE (PrimAppE EqIntP [VarE "n",LitE 0]) + (MkProdE [DataConE (MetaTv $59) + "Nil" + [], + VarE "a"]) + (CaseE (VarE "a") + [("Nil", + [], + MkProdE [DataConE (MetaTv $60) + "Nil" + [], + DataConE (MetaTv $61) + "Nil" + []]), + ("Cons", + [(x, MetaTv $67), + (xs, MetaTv $68)], + LetE (tup63, + [], + MetaTv $64, + AppE "splitAt_plist" + [] + [PrimAppE SubP + [VarE "n", + LitE 1], + VarE "xs"]) + (LetE (c, + [], + MetaTv $66, + ProjE 0 + (VarE "tup63")) + (LetE (d, + [], + MetaTv $65, + ProjE 1 + (VarE "tup63")) + (MkProdE [DataConE (MetaTv $62) + "Cons" + [VarE "x", + VarE "c"], + VarE "d"]))))]), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (map_plist, + FunDef {funName = "map_plist", + funArgs = [f,ls], + funTy = ForAll [u:a,u:b] + (ArrowTy [ArrowTy [TyVar u:a] + (TyVar u:b), + PackedTy "PList" + [TyVar u:a]] + (PackedTy "PList" + [TyVar u:b])), + funBody = CaseE (VarE "ls") + [("Nil", + [], + DataConE (MetaTv $53) "Nil" []), + ("Cons", + [(x, MetaTv $55), + (xs, MetaTv $56)], + DataConE (MetaTv $54) + "Cons" + [AppE "f" [] [VarE "x"], + AppE "map_plist" + [] + [VarE "f", + VarE "xs"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (reverse_plist, + FunDef {funName = "reverse_plist", + funArgs = [xs,acc], + funTy = ForAll [u:a] + (ArrowTy [PackedTy "PList" + [TyVar u:a], + PackedTy "PList" + [TyVar u:a]] + (PackedTy "PList" + [TyVar u:a])), + funBody = CaseE (VarE "xs") + [("Nil", [], VarE "acc"), + ("Cons", + [(z, MetaTv $49), + (zs, MetaTv $50)], + AppE "reverse_plist" + [] + [VarE "zs", + DataConE (MetaTv $48) + "Cons" + [VarE "z", + VarE "acc"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (drop_plist, + FunDef {funName = "drop_plist", + funArgs = [num,list], + funTy = ForAll [u:a] + (ArrowTy [IntTy, + PackedTy "PList" + [TyVar u:a]] + (PackedTy "PList" + [TyVar u:a])), + funBody = CaseE (VarE "list") + [("Nil", + [], + DataConE (MetaTv $42) "Nil" []), + ("Cons", + [(x, MetaTv $44), + (rst, MetaTv $45)], + IfE (PrimAppE LtEqP + [VarE "num", + LitE 0]) + (DataConE (MetaTv $43) + "Cons" + [VarE "x", + VarE "rst"]) + (AppE "drop_plist" + [] + [PrimAppE SubP + [VarE "num", + LitE 1], + VarE "rst"]))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (take_plist, + FunDef {funName = "take_plist", + funArgs = [n,a], + funTy = ForAll [u:a] + (ArrowTy [IntTy, + PackedTy "PList" + [TyVar u:a]] + (PackedTy "PList" + [TyVar u:a])), + funBody = IfE (PrimAppE EqIntP [VarE "n",LitE 0]) + (DataConE (MetaTv $35) "Nil" []) + (CaseE (VarE "a") + [("Nil", + [], + DataConE (MetaTv $36) + "Nil" + []), + ("Cons", + [(z, MetaTv $38), + (zs, MetaTv $39)], + DataConE (MetaTv $37) + "Cons" + [VarE "z", + AppE "take_plist" + [] + [PrimAppE SubP + [VarE "n", + LitE 1], + VarE "zs"]])]), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (filter_plist, + FunDef {funName = "filter_plist", + funArgs = [f,a], + funTy = ForAll [u:a] + (ArrowTy [ArrowTy [TyVar u:a] + BoolTy, + PackedTy "PList" + [TyVar u:a]] + (PackedTy "PList" + [TyVar u:a])), + funBody = CaseE (VarE "a") + [("Nil", + [], + DataConE (MetaTv $29) "Nil" []), + ("Cons", + [(z, MetaTv $31), + (zs, MetaTv $32)], + IfE (AppE "f" [] [VarE "z"]) + (DataConE (MetaTv $30) + "Cons" + [VarE "z", + AppE "filter_plist" + [] + [VarE "f", + VarE "zs"]]) + (AppE "filter_plist" + [] + [VarE "f", + VarE "zs"]))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (length_plist, + FunDef {funName = "length_plist", + funArgs = [a], + funTy = ForAll [u:a] + (ArrowTy [PackedTy "PList" + [TyVar u:a]] + IntTy), + funBody = CaseE (VarE "a") + [("Nil", [], LitE 0), + ("Cons", + [(x, MetaTv $25), + (xs, MetaTv $26)], + PrimAppE AddP + [LitE 1, + AppE "length_plist" + [] + [VarE "xs"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (nth_plist, + FunDef {funName = "nth_plist", + funArgs = [list,def,index,start], + funTy = ForAll [u:a] + (ArrowTy [PackedTy "PList" + [TyVar u:a], + TyVar u:a,IntTy,IntTy] + (TyVar u:a)), + funBody = CaseE (VarE "list") + [("Nil", [], VarE "def"), + ("Cons", + [(x, MetaTv $22), + (rst, MetaTv $23)], + IfE (PrimAppE EqIntP + [VarE "index", + VarE "start"]) + (VarE "x") + (AppE "nth_plist" + [] + [VarE "rst",VarE "def", + VarE "index", + PrimAppE AddP + [VarE "start", + LitE 1]]))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (elem_plist, + FunDef {funName = "elem_plist", + funArgs = [cmp,a,list], + funTy = ForAll [u:a] + (ArrowTy [ArrowTy [TyVar u:a, + TyVar u:a] + IntTy, + TyVar u:a, + PackedTy "PList" + [TyVar u:a]] + BoolTy), + funBody = CaseE (VarE "list") + [("Nil", [], PrimAppE MkFalse []), + ("Cons", + [(x, MetaTv $16), + (rst, MetaTv $17)], + IfE (PrimAppE EqIntP + [AppE "cmp" + [] + [VarE "x", + VarE "a"], + LitE 0]) + (PrimAppE MkTrue []) + (AppE "elem_plist" + [] + [VarE "cmp",VarE "a", + VarE "rst"]))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (tail_plist, + FunDef {funName = "tail_plist", + funArgs = [ls], + funTy = ForAll [u:a] + (ArrowTy [PackedTy "PList" + [TyVar u:a]] + (PackedTy "PList" + [TyVar u:a])), + funBody = CaseE (VarE "ls") + [("Cons", + [(wildcard_10, MetaTv $11), + (xs, MetaTv $12)], + VarE "xs")], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (head_plist, + FunDef {funName = "head_plist", + funArgs = [ls], + funTy = ForAll [u:a] + (ArrowTy [PackedTy "PList" + [TyVar u:a]] + (TyVar u:a)), + funBody = CaseE (VarE "ls") + [("Cons", + [(x, MetaTv $7), + (wildcard_6, MetaTv $8)], + VarE "x")], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}})], + mainExp = Nothing}) + [ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 8 1 8 22, srcInfoPoints = [SrcSpan ".hs" 8 1 8 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 8 8 8 22, srcInfoPoints = []}) "Gibbon.Prelude", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}], + ProgModule "Basics" + (Prog + {ddefs = [(Inline, + DDef {tyName = "Inline", + tyArgs = [], + dataCons = [("Str", [(False, VectorTy CharTy)]), + ("Emph", + [(False, + PackedTy "PList" + [PackedTy "Inline" []])]), + ("Space", [])]}), + (Block, + DDef {tyName = "Block", + tyArgs = [], + dataCons = [("Plain", + [(False, + PackedTy "PList" + [PackedTy "Inline" []])]), + ("Null", [])]}), + (BlogHeader, + DDef {tyName = "BlogHeader", + tyArgs = [], + dataCons = [("Header", [(False, VectorTy CharTy)])]}), + (BlogId, + DDef {tyName = "BlogId", + tyArgs = [], + dataCons = [("ID", [(False, IntTy)])]}), + (BlogAuthor, + DDef {tyName = "BlogAuthor", + tyArgs = [], + dataCons = [("Author", [(False, VectorTy CharTy)])]}), + (BlogDate, + DDef {tyName = "BlogDate", + tyArgs = [], + dataCons = [("Date", [(False, VectorTy CharTy)])]}), + (BlogContent, + DDef {tyName = "BlogContent", + tyArgs = [], + dataCons = [("Content", + [(False, PackedTy "Block" [])])]}), + (BlogTags, + DDef {tyName = "BlogTags", + tyArgs = [], + dataCons = [("TagList", + [(False, + PackedTy "PList" + [VectorTy CharTy])])]}), + (Blog, + DDef {tyName = "Blog", + tyArgs = [], + dataCons = [("End", []), + ("Layout1", + [(False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" []), + (False, PackedTy "BlogContent" []), + (False, PackedTy "BlogTags" []), + (False, PackedTy "Blog" [])]), + ("Layout2", + [(False, PackedTy "BlogContent" []), + (False, PackedTy "BlogTags" []), + (False, PackedTy "Blog" []), + (False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" [])]), + ("Layout3", + [(False, PackedTy "BlogTags" []), + (False, PackedTy "Blog" []), + (False, PackedTy "BlogContent" []), + (False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" [])]), + ("Layout4", + [(False, PackedTy "BlogTags" []), + (False, PackedTy "BlogContent" []), + (False, PackedTy "Blog" []), + (False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" [])]), + ("Layout5", + [(False, PackedTy "Blog" []), + (False, PackedTy "BlogTags" []), + (False, PackedTy "BlogContent" []), + (False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" [])]), + ("Layout6", + [(False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" []), + (False, PackedTy "BlogContent" []), + (False, PackedTy "Blog" []), + (False, PackedTy "BlogTags" [])]), + ("Layout7", + [(False, PackedTy "Blog" []), + (False, PackedTy "BlogContent" []), + (False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" []), + (False, PackedTy "BlogTags" [])]), + ("Layout8", + [(False, PackedTy "BlogContent" []), + (False, PackedTy "Blog" []), + (False, PackedTy "BlogId" []), + (False, PackedTy "BlogAuthor" []), + (False, PackedTy "BlogDate" []), + (False, PackedTy "BlogHeader" []), + (False, PackedTy "BlogTags" [])])]})], + fundefs = [(emphasizeKeywordInBlock, + FunDef {funName = "emphasizeKeywordInBlock", + funArgs = [keyword,contentBlock], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "Block" []] + (PackedTy "Block" [])), + funBody = CaseE (VarE "contentBlock") + [("Plain", + [(list_inline, MetaTv $91)], + DataConE (MetaTv $90) + "Plain" + [AppE "emphasizeInlineListForKeyword" + [] + [VarE "keyword", + VarE "list_inline"]]), + ("Null", + [], + DataConE (MetaTv $92) + "Null" + [])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (blogLength, + FunDef {funName = "blogLength", + funArgs = [blog], + funTy = ForAll [] + (ArrowTy [PackedTy "Blog" []] + IntTy), + funBody = CaseE (VarE "blog") + [("End", [], LitE 0), + ("Layout1", + [(a, MetaTv $234), + (b, MetaTv $235), + (c, MetaTv $236), + (d, MetaTv $237), + (e, MetaTv $238), + (f, MetaTv $239), + (rst, MetaTv $240)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]]), + ("Layout2", + [(a, MetaTv $241), + (b, MetaTv $242), + (rst, MetaTv $243), + (c, MetaTv $244), + (d, MetaTv $245), + (e, MetaTv $246), + (f, MetaTv $247)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]]), + ("Layout3", + [(a, MetaTv $248), + (rst, MetaTv $249), + (b, MetaTv $250), + (c, MetaTv $251), + (d, MetaTv $252), + (e, MetaTv $253), + (f, MetaTv $254)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]]), + ("Layout4", + [(a, MetaTv $255), + (b, MetaTv $256), + (rst, MetaTv $257), + (d, MetaTv $258), + (e, MetaTv $259), + (f, MetaTv $260), + (g, MetaTv $261)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]]), + ("Layout5", + [(rst, MetaTv $262), + (a, MetaTv $263), + (b, MetaTv $264), + (c, MetaTv $265), + (d, MetaTv $266), + (e, MetaTv $267), + (f, MetaTv $268)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]]), + ("Layout6", + [(a, MetaTv $269), + (b, MetaTv $270), + (c, MetaTv $271), + (d, MetaTv $272), + (e, MetaTv $273), + (rst, MetaTv $274), + (f, MetaTv $275)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]]), + ("Layout7", + [(rst, MetaTv $276), + (a, MetaTv $277), + (b, MetaTv $278), + (c, MetaTv $279), + (d, MetaTv $280), + (e, MetaTv $281), + (f, MetaTv $282)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]]), + ("Layout8", + [(a, MetaTv $283), + (rst, MetaTv $284), + (b, MetaTv $285), + (c, MetaTv $286), + (d, MetaTv $287), + (e, MetaTv $288), + (f, MetaTv $289)], + PrimAppE AddP + [LitE 1, + AppE "blogLength" + [] + [VarE "rst"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (getChar, + FunDef {funName = "getChar", + funArgs = [decimal], + funTy = ForAll [] (ArrowTy [IntTy] CharTy), + funBody = IfE (PrimAppE EqIntP + [VarE "decimal",LitE 0]) + (CharE 'a') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 1]) + (CharE 'b') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 2]) + (CharE 'c') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 3]) + (CharE 'd') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 4]) + (CharE 'e') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 5]) + (CharE 'f') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 6]) + (CharE 'g') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 7]) + (CharE 'h') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 8]) + (CharE 'i') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 9]) + (CharE 'j') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 10]) + (CharE 'k') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 11]) + (CharE 'l') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 12]) + (CharE 'm') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 13]) + (CharE 'n') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 14]) + (CharE 'o') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 15]) + (CharE 'p') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 16]) + (CharE 'q') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 17]) + (CharE 'r') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 18]) + (CharE 's') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 19]) + (CharE 't') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 20]) + (CharE 'u') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 21]) + (CharE 'v') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 22]) + (CharE 'w') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 23]) + (CharE 'x') + (IfE (PrimAppE EqIntP + [VarE "decimal", + LitE 24]) + (CharE 'y') + (CharE 'z'))))))))))))))))))))))))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printInline, + FunDef {funName = "printInline", + funArgs = [inline], + funTy = ForAll [] + (ArrowTy [PackedTy "Inline" []] + (ProdTy [])), + funBody = CaseE (VarE "inline") + [("Str", + [(text, MetaTv $394)], + LetE (wildcard_392, + [], + MetaTv $393, + PrimAppE PrintSym + [LitSymE "Str "]) + (LetE (wildcard_390, + [], + MetaTv $391, + AppE "printVec" + [] + [Ext (LambdaE [(i, + MetaTv $389)] + (PrimAppE PrintChar + [VarE "i"])), + VarE "text"]) + (MkProdE []))), + ("Emph", + [(plist, MetaTv $399)], + LetE (wildcard_397, + [], + MetaTv $398, + PrimAppE PrintSym + [LitSymE "Emph "]) + (LetE (wildcard_395, + [], + MetaTv $396, + AppE "printPlistInline" + [] + [VarE "plist"]) + (MkProdE []))), + ("Space", + [], + LetE (wildcard_400, + [], + MetaTv $401, + PrimAppE PrintSym + [LitSymE "Space "]) + (MkProdE []))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printPlistText, + FunDef {funName = "printPlistText", + funArgs = [list], + funTy = ForAll [] + (ArrowTy [PackedTy "PList" + [VectorTy CharTy]] + (ProdTy [])), + funBody = CaseE (VarE "list") + [("Cons", + [(x, MetaTv $384), + (rst, MetaTv $385)], + LetE (wildcard_382, + [], + MetaTv $383, + PrimAppE PrintSym + [LitSymE "PList ( Cons "]) + (LetE (wildcard_380, + [], + MetaTv $381, + AppE "printVec" + [] + [Ext (LambdaE [(i, + MetaTv $379)] + (PrimAppE PrintChar + [VarE "i"])), + VarE "x"]) + (LetE (wildcard_377, + [], + MetaTv $378, + AppE "printPlistText" + [] + [VarE "rst"]) + (LetE (wildcard_375, + [], + MetaTv $376, + PrimAppE PrintSym + [LitSymE " ) "]) + (MkProdE []))))), + ("Nil", + [], + LetE (wildcard_386, + [], + MetaTv $387, + PrimAppE PrintSym + [LitSymE "Nil"]) + (MkProdE []))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printPlistInline, + FunDef {funName = "printPlistInline", + funArgs = [list], + funTy = ForAll [] + (ArrowTy [PackedTy "PList" + [PackedTy "Inline" + []]] + (ProdTy [])), + funBody = CaseE (VarE "list") + [("Cons", + [(x, MetaTv $370), + (rst, MetaTv $371)], + LetE (wildcard_368, + [], + MetaTv $369, + PrimAppE PrintSym + [LitSymE "PList ( Cons "]) + (LetE (wildcard_366, + [], + MetaTv $367, + AppE "printInline" + [] + [VarE "x"]) + (LetE (wildcard_364, + [], + MetaTv $365, + AppE "printPlistInline" + [] + [VarE "rst"]) + (LetE (wildcard_362, + [], + MetaTv $363, + PrimAppE PrintSym + [LitSymE " ) "]) + (MkProdE []))))), + ("Nil", + [], + LetE (wildcard_372, + [], + MetaTv $373, + PrimAppE PrintSym + [LitSymE "Nil"]) + (MkProdE []))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printBlock, + FunDef {funName = "printBlock", + funArgs = [block], + funTy = ForAll [] + (ArrowTy [PackedTy "Block" []] + (ProdTy [])), + funBody = CaseE (VarE "block") + [("Plain", + [(plist, MetaTv $358)], + LetE (wildcard_356, + [], + MetaTv $357, + PrimAppE PrintSym + [LitSymE "Plain "]) + (LetE (wildcard_354, + [], + MetaTv $355, + AppE "printPlistInline" + [] + [VarE "plist"]) + (MkProdE []))), + ("Null", + [], + LetE (wildcard_359, + [], + MetaTv $360, + PrimAppE PrintSym + [LitSymE "Null"]) + (MkProdE []))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printBlog, + FunDef {funName = "printBlog", + funArgs = [blog], + funTy = ForAll [] + (ArrowTy [PackedTy "Blog" []] + (ProdTy [])), + funBody = CaseE (VarE "blog") + [("Layout1", + [(header, MetaTv $346), + (id, MetaTv $347), + (author, MetaTv $348), + (date, MetaTv $349), + (content, MetaTv $350), + (tags, MetaTv $351), + (rst, MetaTv $352)], + LetE (wildcard_344, + [], + MetaTv $345, + PrimAppE PrintSym + [LitSymE "Layout1 "]) + (LetE (wildcard_342, + [], + MetaTv $343, + AppE "printHeader" + [] + [VarE "header"]) + (LetE (wildcard_340, + [], + MetaTv $341, + AppE "printID" + [] + [VarE "id"]) + (LetE (wildcard_338, + [], + MetaTv $339, + AppE "printAuthor" + [] + [VarE "author"]) + (LetE (wildcard_336, + [], + MetaTv $337, + AppE "printDate" + [] + [VarE "date"]) + (LetE (wildcard_334, + [], + MetaTv $335, + AppE "printContent" + [] + [VarE "content"]) + (LetE (wildcard_332, + [], + MetaTv $333, + AppE "printTagList" + [] + [VarE "tags"]) + (LetE (wildcard_330, + [], + MetaTv $331, + AppE "printBlog" + [] + [VarE "rst"]) + (MkProdE [])))))))))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printID, + FunDef {funName = "printID", + funArgs = [id], + funTy = ForAll [] + (ArrowTy [PackedTy "BlogId" []] + (ProdTy [])), + funBody = CaseE (VarE "id") + [("ID", + [(val, MetaTv $328)], + LetE (wildcard_326, + [], + MetaTv $327, + PrimAppE PrintSym + [LitSymE "ID "]) + (LetE (wildcard_324, + [], + MetaTv $325, + PrimAppE PrintInt + [VarE "val"]) + (MkProdE [])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printHeader, + FunDef {funName = "printHeader", + funArgs = [header], + funTy = ForAll [] + (ArrowTy [PackedTy "BlogHeader" []] + (ProdTy [])), + funBody = CaseE (VarE "header") + [("Header", + [(str, MetaTv $322)], + LetE (wildcard_320, + [], + MetaTv $321, + PrimAppE PrintSym + [LitSymE "Header "]) + (LetE (wildcard_318, + [], + MetaTv $319, + AppE "printVec" + [] + [Ext (LambdaE [(i, + MetaTv $317)] + (PrimAppE PrintChar + [VarE "i"])), + VarE "str"]) + (MkProdE [])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printAuthor, + FunDef {funName = "printAuthor", + funArgs = [date], + funTy = ForAll [] + (ArrowTy [PackedTy "BlogAuthor" []] + (ProdTy [])), + funBody = CaseE (VarE "date") + [("Author", + [(str, MetaTv $315)], + LetE (wildcard_313, + [], + MetaTv $314, + PrimAppE PrintSym + [LitSymE "Author "]) + (LetE (wildcard_311, + [], + MetaTv $312, + AppE "printVec" + [] + [Ext (LambdaE [(i, + MetaTv $310)] + (PrimAppE PrintChar + [VarE "i"])), + VarE "str"]) + (MkProdE [])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printDate, + FunDef {funName = "printDate", + funArgs = [date], + funTy = ForAll [] + (ArrowTy [PackedTy "BlogDate" []] + (ProdTy [])), + funBody = CaseE (VarE "date") + [("Date", + [(str, MetaTv $308)], + LetE (wildcard_306, + [], + MetaTv $307, + PrimAppE PrintSym + [LitSymE "Date "]) + (LetE (wildcard_304, + [], + MetaTv $305, + AppE "printVec" + [] + [Ext (LambdaE [(i, + MetaTv $303)] + (PrimAppE PrintChar + [VarE "i"])), + VarE "str"]) + (MkProdE [])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printTagList, + FunDef {funName = "printTagList", + funArgs = [tags], + funTy = ForAll [] + (ArrowTy [PackedTy "BlogTags" []] + (ProdTy [])), + funBody = CaseE (VarE "tags") + [("TagList", + [(plist, MetaTv $301)], + LetE (wildcard_299, + [], + MetaTv $300, + PrimAppE PrintSym + [LitSymE "TagList "]) + (LetE (wildcard_297, + [], + MetaTv $298, + AppE "printPlistText" + [] + [VarE "plist"]) + (MkProdE [])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printContent, + FunDef {funName = "printContent", + funArgs = [content], + funTy = ForAll [] + (ArrowTy [PackedTy "BlogContent" []] + (ProdTy [])), + funBody = CaseE (VarE "content") + [("Content", + [(block, MetaTv $295)], + LetE (wildcard_293, + [], + MetaTv $294, + PrimAppE PrintSym + [LitSymE "Content "]) + (LetE (wildcard_291, + [], + MetaTv $292, + AppE "printBlock" + [] + [VarE "block"]) + (MkProdE [])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkBlockList, + FunDef {funName = "mkBlockList", + funArgs = [length,base], + funTy = ForAll [] + (ArrowTy [IntTy,IntTy] + (PackedTy "PList" + [PackedTy "Block" + []])), + funBody = IfE (PrimAppE LtEqP + [VarE "length",LitE 0]) + (DataConE (MetaTv $224) "Nil" []) + (IfE (PrimAppE EqIntP + [VarE "base",LitE 0]) + (LetE (item, + [], + MetaTv $228, + DataConE (MetaTv $227) + "Plain" + [AppE "mkInlineList" + [] + [LitE 1000, + LitE 1]]) + (LetE (rst, + [], + MetaTv $226, + AppE "mkBlockList" + [] + [PrimAppE SubP + [VarE "length", + LitE 1], + VarE "base"]) + (DataConE (MetaTv $225) + "Cons" + [VarE "item", + VarE "rst"]))) + (LetE (item, + [], + MetaTv $232, + DataConE (MetaTv $231) + "Null" + []) + (LetE (rst, + [], + MetaTv $230, + AppE "mkBlockList" + [] + [PrimAppE SubP + [VarE "length", + LitE 1], + VarE "base"]) + (DataConE (MetaTv $229) + "Cons" + [VarE "item", + VarE "rst"])))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkSomeTags, + FunDef {funName = "mkSomeTags", + funArgs = [len], + funTy = ForAll [] + (ArrowTy [IntTy] + (PackedTy "PList" + [VectorTy CharTy])), + funBody = IfE (PrimAppE LtEqP [VarE "len",LitE 0]) + (DataConE (MetaTv $217) "Nil" []) + (LetE (word, + [], + MetaTv $221, + LetE (vec220, + [], + VectorTy CharTy, + PrimAppE (VAllocP CharTy) + [LitE 1]) + (LetE (_, + [], + VectorTy CharTy, + PrimAppE (InplaceVUpdateP CharTy) + [VarE "vec220", + LitE 0, + CharE 'a']) + (VarE "vec220"))) + (LetE (rst, + [], + MetaTv $219, + AppE "mkSomeTags" + [] + [PrimAppE SubP + [VarE "len", + LitE 1]]) + (DataConE (MetaTv $218) + "Cons" + [VarE "word", + VarE "rst"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkRandomInlineList, + FunDef {funName = "mkRandomInlineList", + funArgs = [len], + funTy = ForAll [] + (ArrowTy [IntTy] + (PackedTy "PList" + [PackedTy "Inline" + []])), + funBody = IfE (PrimAppE LtEqP [VarE "len",LitE 0]) + (DataConE (MetaTv $211) "Nil" []) + (LetE (word, + [], + MetaTv $215, + DataConE (MetaTv $214) + "Str" + [AppE "getRandomString" + [] + [LitE 1]]) + (LetE (rst, + [], + MetaTv $213, + AppE "mkRandomInlineList" + [] + [PrimAppE SubP + [VarE "len", + LitE 1]]) + (DataConE (MetaTv $212) + "Cons" + [VarE "word", + VarE "rst"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkInlineList', + FunDef {funName = "mkInlineList'", + funArgs = [length,index,words], + funTy = ForAll [] + (ArrowTy [IntTy,IntTy, + VectorTy (VectorTy CharTy)] + (PackedTy "PList" + [PackedTy "Inline" + []])), + funBody = IfE (PrimAppE GtEqP + [VarE "index", + VarE "length"]) + (DataConE (MetaTv $205) "Nil" []) + (LetE (item, + [], + MetaTv $209, + DataConE (MetaTv $208) + "Str" + [AppE "nth" + [] + [VarE "words", + VarE "index"]]) + (LetE (rst, + [], + MetaTv $207, + AppE "mkInlineList'" + [] + [VarE "length", + PrimAppE AddP + [VarE "index", + LitE 1], + VarE "words"]) + (DataConE (MetaTv $206) + "Cons" + [VarE "item", + VarE "rst"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkInlineList, + FunDef {funName = "mkInlineList", + funArgs = [length,base], + funTy = ForAll [] + (ArrowTy [IntTy,IntTy] + (PackedTy "PList" + [PackedTy "Inline" + []])), + funBody = IfE (PrimAppE LtEqP + [VarE "length",LitE 0]) + (DataConE (MetaTv $194) "Nil" []) + (IfE (PrimAppE EqIntP + [VarE "base",LitE 0]) + (LetE (item, + [], + MetaTv $198, + DataConE (MetaTv $197) + "Emph" + [AppE "mkInlineList" + [] + [LitE 100, + LitE 1]]) + (LetE (rst, + [], + MetaTv $196, + AppE "mkInlineList" + [] + [PrimAppE SubP + [VarE "length", + LitE 1], + VarE "base"]) + (DataConE (MetaTv $195) + "Cons" + [VarE "item", + VarE "rst"]))) + (LetE (item, + [], + MetaTv $201, + AppE "mkInlineBaseCase" + [] + [PrimAppE ModP + [PrimAppE RandP + [], + LitE 4]]) + (LetE (rst, + [], + MetaTv $200, + AppE "mkInlineList" + [] + [PrimAppE SubP + [VarE "length", + LitE 1], + VarE "base"]) + (DataConE (MetaTv $199) + "Cons" + [VarE "item", + VarE "rst"])))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkInlineBaseCase, + FunDef {funName = "mkInlineBaseCase", + funArgs = [option], + funTy = ForAll [] + (ArrowTy [IntTy] + (PackedTy "Inline" [])), + funBody = IfE (PrimAppE EqIntP + [VarE "option",LitE 0]) + (DataConE (MetaTv $190) + "Str" + [AppE "getRandomString" + [] + [LitE 5]]) + (DataConE (MetaTv $191) "Space" []), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkContentFromText, + FunDef {funName = "mkContentFromText", + funArgs = [f], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy] + (PackedTy "BlogContent" + [])), + funBody = LetE (block, + [], + MetaTv $188, + AppE "fileToContent" + [] + [VarE "f", + AppE "singleton" + [] + [AppE "nth" + [] + [VarE "f", + LitE 0]], + DataConE (MetaTv $186) + "Nil" + [], + LitE 1, + PrimAppE (VLengthP (MetaTv $187)) + [VarE "f"]]) + (LetE (content, + [], + MetaTv $185, + AppE "mkBlogContent" + [] + [VarE "block"]) + (VarE "content")), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkTagsFromText, + FunDef {funName = "mkTagsFromText", + funArgs = [f'], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy] + (PackedTy "BlogTags" [])), + funBody = LetE (tags, + [], + MetaTv $183, + AppE "fileToTags" + [] + [VarE "f'", + AppE "singleton" + [] + [AppE "nth" + [] + [VarE "f'", + LitE 0]], + LitE 1, + PrimAppE (VLengthP (MetaTv $182)) + [VarE "f'"]]) + (LetE (tags', + [], + MetaTv $181, + DataConE (MetaTv $180) + "TagList" + [VarE "tags"]) + (VarE "tags'")), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (fileToTags, + FunDef {funName = "fileToTags", + funArgs = [file,word,index,max_len], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + VectorTy CharTy,IntTy, + IntTy] + (PackedTy "PList" + [VectorTy CharTy])), + funBody = IfE (PrimAppE GtEqP + [VarE "index", + VarE "max_len"]) + (DataConE (MetaTv $174) "Nil" []) + (LetE (character, + [], + CharTy, + AppE "nth" + [] + [VarE "file", + VarE "index"]) + (LetE (isSpace, + [], + MetaTv $178, + IfE (PrimAppE EqCharP + [VarE "character", + AppE "head" + [] + [LetE (vec177, + [], + VectorTy CharTy, + PrimAppE (VAllocP CharTy) + [LitE 1]) + (LetE (_, + [], + VectorTy CharTy, + PrimAppE (InplaceVUpdateP CharTy) + [VarE "vec177", + LitE 0, + CharE ' ']) + (VarE "vec177"))]]) + (PrimAppE MkTrue []) + (PrimAppE MkFalse + [])) + (LetE (char_vec, + [], + MetaTv $176, + AppE "singleton" + [] + [VarE "character"]) + (IfE (VarE "isSpace") + (DataConE (MetaTv $175) + "Cons" + [VarE "word", + AppE "fileToTags" + [] + [VarE "file", + AppE "singleton" + [] + [AppE "nth" + [] + [VarE "file", + PrimAppE AddP + [VarE "index", + LitE 1]]], + PrimAppE AddP + [VarE "index", + LitE 2], + VarE "max_len"]]) + (AppE "fileToTags" + [] + [VarE "file", + AppE "append" + [] + [VarE "word", + VarE "char_vec"], + PrimAppE AddP + [VarE "index", + LitE 1], + VarE "max_len"]))))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (printWordList, + FunDef {funName = "printWordList", + funArgs = [vec,start,end], + funTy = ForAll [] + (ArrowTy [VectorTy (VectorTy CharTy), + IntTy,IntTy] + (ProdTy [])), + funBody = IfE (PrimAppE LtP + [VarE "start",VarE "end"]) + (LetE (element, + [], + MetaTv $169, + AppE "nth" + [] + [VarE "vec", + VarE "start"]) + (LetE (wildcard_167, + [], + MetaTv $168, + AppE "printVec" + [] + [Ext (LambdaE [(i, + MetaTv $166)] + (PrimAppE PrintChar + [VarE "i"])), + VarE "element"]) + (AppE "printWordList" + [] + [VarE "vec", + PrimAppE AddP + [VarE "start", + LitE 1], + VarE "end"]))) + (MkProdE []), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (fileToContent', + FunDef {funName = "fileToContent'", + funArgs = [file,word,running_list,index,max_len], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + VectorTy CharTy, + VectorTy (VectorTy CharTy), + IntTy,IntTy] + (VectorTy (VectorTy CharTy))), + funBody = IfE (PrimAppE GtEqP + [VarE "index", + VarE "max_len"]) + (AppE "append" + [] + [VarE "running_list", + PrimAppE (VAllocP (MetaTv $158)) + [LitE 0]]) + (LetE (character, + [], + CharTy, + AppE "nth" + [] + [VarE "file", + VarE "index"]) + (LetE (isSpace, + [], + MetaTv $162, + IfE (PrimAppE EqCharP + [VarE "character", + AppE "head" + [] + [LetE (vec161, + [], + VectorTy CharTy, + PrimAppE (VAllocP CharTy) + [LitE 1]) + (LetE (_, + [], + VectorTy CharTy, + PrimAppE (InplaceVUpdateP CharTy) + [VarE "vec161", + LitE 0, + CharE ' ']) + (VarE "vec161"))]]) + (PrimAppE MkTrue []) + (PrimAppE MkFalse + [])) + (LetE (char_vec, + [], + MetaTv $160, + AppE "singleton" + [] + [VarE "character"]) + (IfE (VarE "isSpace") + (AppE "fileToContent'" + [] + [VarE "file", + AppE "singleton" + [] + [AppE "nth" + [] + [VarE "file", + PrimAppE AddP + [VarE "index", + LitE 1]]], + AppE "append" + [] + [VarE "running_list", + AppE "generate" + [] + [LitE 1, + Ext (LambdaE [(i, + MetaTv $159)] + (VarE "word"))]], + PrimAppE AddP + [VarE "index", + LitE 2], + VarE "max_len"]) + (AppE "fileToContent'" + [] + [VarE "file", + AppE "append" + [] + [VarE "word", + VarE "char_vec"], + VarE "running_list", + PrimAppE AddP + [VarE "index", + LitE 1], + VarE "max_len"]))))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (fileToContent, + FunDef {funName = "fileToContent", + funArgs = [file,word,plist_inline,index,max_len], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + VectorTy CharTy, + PackedTy "PList" + [PackedTy "Inline" + []], + IntTy,IntTy] + (PackedTy "Block" [])), + funBody = IfE (PrimAppE GtEqP + [VarE "index", + VarE "max_len"]) + (DataConE (MetaTv $147) + "Plain" + [VarE "plist_inline"]) + (LetE (character, + [], + CharTy, + AppE "nth" + [] + [VarE "file", + VarE "index"]) + (LetE (isSpace, + [], + MetaTv $152, + IfE (PrimAppE EqCharP + [VarE "character", + AppE "head" + [] + [LetE (vec151, + [], + VectorTy CharTy, + PrimAppE (VAllocP CharTy) + [LitE 1]) + (LetE (_, + [], + VectorTy CharTy, + PrimAppE (InplaceVUpdateP CharTy) + [VarE "vec151", + LitE 0, + CharE ' ']) + (VarE "vec151"))]]) + (PrimAppE MkTrue []) + (PrimAppE MkFalse + [])) + (LetE (char_vec, + [], + MetaTv $150, + AppE "singleton" + [] + [VarE "character"]) + (IfE (VarE "isSpace") + (AppE "fileToContent" + [] + [VarE "file", + AppE "singleton" + [] + [AppE "nth" + [] + [VarE "file", + PrimAppE AddP + [VarE "index", + LitE 1]]], + DataConE (MetaTv $148) + "Cons" + [DataConE (MetaTv $149) + "Str" + [VarE "word"], + VarE "plist_inline"], + PrimAppE AddP + [VarE "index", + LitE 2], + VarE "max_len"]) + (AppE "fileToContent" + [] + [VarE "file", + AppE "append" + [] + [VarE "word", + VarE "char_vec"], + VarE "plist_inline", + PrimAppE AddP + [VarE "index", + LitE 1], + VarE "max_len"]))))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (searchBlogContent, + FunDef {funName = "searchBlogContent", + funArgs = [keyword,content], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "BlogContent" []] + BoolTy), + funBody = CaseE (VarE "content") + [("Content", + [(block, MetaTv $141)], + AppE "isKeywordPresentInBlock" + [] + [VarE "keyword", + VarE "block"])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (emphasizeBlogContent, + FunDef {funName = "emphasizeBlogContent", + funArgs = [keyword,oldContent], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "BlogContent" []] + (PackedTy "BlogContent" + [])), + funBody = CaseE (VarE "oldContent") + [("Content", + [(block, MetaTv $138)], + DataConE (MetaTv $137) + "Content" + [AppE "emphasizeKeywordInBlock" + [] + [VarE "keyword", + VarE "block"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (emphasizeBlogContent', + FunDef {funName = "emphasizeBlogContent'", + funArgs = [keyword,oldContent], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "BlogContent" []] + (PackedTy "BlogContent" + [])), + funBody = CaseE (VarE "oldContent") + [("Content", + [(block, MetaTv $134)], + DataConE (MetaTv $133) + "Content" + [AppE "emphasizeKeywordInBlock" + [] + [VarE "keyword", + VarE "block"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (insertBlogTags, + FunDef {funName = "insertBlogTags", + funArgs = [keyword,tags], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "BlogTags" []] + (PackedTy "BlogTags" [])), + funBody = CaseE (VarE "tags") + [("TagList", + [(list, MetaTv $130)], + DataConE (MetaTv $129) + "TagList" + [AppE "insertTagList" + [] + [VarE "keyword", + VarE "list"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (deleteBlogTags, + FunDef {funName = "deleteBlogTags", + funArgs = [keyword,tags], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "BlogTags" []] + (PackedTy "BlogTags" [])), + funBody = CaseE (VarE "tags") + [("TagList", + [(list, MetaTv $126)], + DataConE (MetaTv $125) + "TagList" + [AppE "deleteTagList" + [] + [VarE "keyword", + VarE "list"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (searchBlogTags, + FunDef {funName = "searchBlogTags", + funArgs = [keyword,tags], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "BlogTags" []] + BoolTy), + funBody = CaseE (VarE "tags") + [("TagList", + [(list, MetaTv $122)], + AppE "searchTagList" + [] + [VarE "keyword", + VarE "list"])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (emphasizeKeywordInBlockList, + FunDef {funName = "emphasizeKeywordInBlockList", + funArgs = [keyword,block_list], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "PList" + [PackedTy "Block" + []]] + (PackedTy "PList" + [PackedTy "Block" + []])), + funBody = CaseE (VarE "block_list") + [("Nil", + [], + DataConE (MetaTv $114) "Nil" []), + ("Cons", + [(block, MetaTv $118), + (rst, MetaTv $119)], + LetE (newBlock, + [], + MetaTv $117, + AppE "emphasizeKeywordInBlock" + [] + [VarE "keyword", + VarE "block"]) + (LetE (rst', + [], + MetaTv $116, + AppE "emphasizeKeywordInBlockList" + [] + [VarE "keyword", + VarE "rst"]) + (DataConE (MetaTv $115) + "Cons" + [VarE "newBlock", + VarE "rst'"])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (emphasizeInlineListForKeyword, + FunDef {funName = "emphasizeInlineListForKeyword", + funArgs = [keyword,inline_list], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "PList" + [PackedTy "Inline" + []]] + (PackedTy "PList" + [PackedTy "Inline" + []])), + funBody = CaseE (VarE "inline_list") + [("Nil", + [], + DataConE (MetaTv $106) "Nil" []), + ("Cons", + [(inline, MetaTv $110), + (rst, MetaTv $111)], + LetE (newinline, + [], + MetaTv $109, + AppE "emphasizeKeywordInline" + [] + [VarE "keyword", + VarE "inline"]) + (LetE (rst', + [], + MetaTv $108, + AppE "emphasizeInlineListForKeyword" + [] + [VarE "keyword", + VarE "rst"]) + (DataConE (MetaTv $107) + "Cons" + [VarE "newinline", + VarE "rst'"])))], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (emphasizeKeywordInline, + FunDef {funName = "emphasizeKeywordInline", + funArgs = [keyword,inline], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "Inline" []] + (PackedTy "Inline" [])), + funBody = CaseE (VarE "inline") + [("Str", + [(text, MetaTv $100)], + LetE (isSame, + [], + MetaTv $99, + AppE "compareWord" + [] + [VarE "keyword", + VarE "text"]) + (IfE (VarE "isSame") + (LetE (newlist, + [], + PackedTy "PList" + [PackedTy "Inline" + []], + DataConE (MetaTv $96) + "Cons" + [Ext (CopyPacked (MetaTv $97) + (VarE "inline")), + DataConE (MetaTv $98) + "Nil" + []]) + (DataConE (MetaTv $95) + "Emph" + [VarE "newlist"])) + (VarE "inline"))), + ("Emph", + [(list_inline, MetaTv $102)], + DataConE (MetaTv $101) + "Emph" + [AppE "emphasizeInlineListForKeyword" + [] + [VarE "keyword", + VarE "list_inline"]]), + ("Space", + [], + DataConE (MetaTv $103) + "Space" + [])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (searchInlineListForKeyword, + FunDef {funName = "searchInlineListForKeyword", + funArgs = [keyword,inline_list], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "PList" + [PackedTy "Inline" + []]] + BoolTy), + funBody = CaseE (VarE "inline_list") + [("Nil", [], PrimAppE MkFalse []), + ("Cons", + [(inline, MetaTv $86), + (rst, MetaTv $87)], + PrimAppE OrP + [AppE "isKeywordPresentInline" + [] + [VarE "keyword", + VarE "inline"], + AppE "searchInlineListForKeyword" + [] + [VarE "keyword", + VarE "rst"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (searchBlockListForKeyword, + FunDef {funName = "searchBlockListForKeyword", + funArgs = [keyword,block_list], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "PList" + [PackedTy "Block" + []]] + BoolTy), + funBody = CaseE (VarE "block_list") + [("Nil", [], PrimAppE MkFalse []), + ("Cons", + [(block, MetaTv $82), + (rst, MetaTv $83)], + PrimAppE OrP + [AppE "isKeywordPresentInBlock" + [] + [VarE "keyword", + VarE "block"], + AppE "searchBlockListForKeyword" + [] + [VarE "keyword", + VarE "rst"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (isKeywordPresentInline, + FunDef {funName = "isKeywordPresentInline", + funArgs = [keyword,inline], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "Inline" []] + BoolTy), + funBody = CaseE (VarE "inline") + [("Str", + [(text, MetaTv $78)], + AppE "compareWord" + [] + [VarE "keyword", + VarE "text"]), + ("Emph", + [(list_inline, MetaTv $79)], + AppE "searchInlineListForKeyword" + [] + [VarE "keyword", + VarE "list_inline"]), + ("Space", + [], + PrimAppE MkFalse [])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (isKeywordPresentInBlock, + FunDef {funName = "isKeywordPresentInBlock", + funArgs = [keyword,contentBlock], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "Block" []] + BoolTy), + funBody = CaseE (VarE "contentBlock") + [("Plain", + [(list_inline, MetaTv $75)], + AppE "searchInlineListForKeyword" + [] + [VarE "keyword", + VarE "list_inline"]), + ("Null", + [], + PrimAppE MkFalse [])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (insertTagList, + FunDef {funName = "insertTagList", + funArgs = [keyword,taglist], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "PList" + [VectorTy CharTy]] + (PackedTy "PList" + [VectorTy CharTy])), + funBody = CaseE (VarE "taglist") + [("Nil", + [], + DataConE (MetaTv $69) + "Cons" + [VarE "keyword", + DataConE (MetaTv $70) + "Nil" + []]), + ("Cons", + [(word, MetaTv $71), + (rst, MetaTv $72)], + AppE "insertTagList" + [] + [VarE "keyword", + VarE "rst"])], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (deleteTagList, + FunDef {funName = "deleteTagList", + funArgs = [keyword,taglist], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "PList" + [VectorTy CharTy]] + (PackedTy "PList" + [VectorTy CharTy])), + funBody = CaseE (VarE "taglist") + [("Nil", + [], + DataConE (MetaTv $63) "Nil" []), + ("Cons", + [(word, MetaTv $65), + (rst, MetaTv $66)], + IfE (AppE "compareWord" + [] + [VarE "keyword", + VarE "word"]) + (AppE "deleteTagList" + [] + [VarE "keyword", + VarE "rst"]) + (DataConE (MetaTv $64) + "Cons" + [VarE "word", + AppE "deleteTagList" + [] + [VarE "keyword", + VarE "rst"]]))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (searchTagList, + FunDef {funName = "searchTagList", + funArgs = [keyword,taglist], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "PList" + [VectorTy CharTy]] + BoolTy), + funBody = CaseE (VarE "taglist") + [("Nil", [], PrimAppE MkFalse []), + ("Cons", + [(word, MetaTv $59), + (rst, MetaTv $60)], + PrimAppE OrP + [AppE "compareWord" + [] + [VarE "keyword", + VarE "word"], + AppE "searchTagList" + [] + [VarE "keyword", + VarE "rst"]])], + funMeta = FunMeta {funRec = NotRec, + funInline = Inline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (cmp, + FunDef {funName = "cmp", + funArgs = [start,end,word1,word2], + funTy = ForAll [] + (ArrowTy [IntTy,IntTy, + VectorTy CharTy, + VectorTy CharTy] + BoolTy), + funBody = IfE (PrimAppE LtP + [VarE "start",VarE "end"]) + (LetE (a, + [], + MetaTv $56, + AppE "nth" + [] + [VarE "word1", + VarE "start"]) + (LetE (b, + [], + MetaTv $55, + AppE "nth" + [] + [VarE "word2", + VarE "start"]) + (LetE (eq, + [], + MetaTv $54, + IfE (PrimAppE EqCharP + [VarE "a", + VarE "b"]) + (PrimAppE MkTrue + []) + (PrimAppE MkFalse + [])) + (LetE (recurse, + [], + MetaTv $53, + AppE "cmp" + [] + [PrimAppE AddP + [VarE "start", + LitE 1], + VarE "end", + VarE "word1", + VarE "word2"]) + (PrimAppE AndP + [VarE "eq", + VarE "recurse"]))))) + (PrimAppE MkTrue []), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (compareWord, + FunDef {funName = "compareWord", + funArgs = [word1,word2], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + VectorTy CharTy] + BoolTy), + funBody = LetE (len1, + [], + MetaTv $48, + AppE "length" [] [VarE "word1"]) + (LetE (len2, + [], + MetaTv $47, + AppE "length" + [] + [VarE "word2"]) + (LetE (compare_len, + [], + MetaTv $46, + IfE (PrimAppE EqIntP + [VarE "len1", + VarE "len2"]) + (PrimAppE MkTrue + []) + (PrimAppE MkFalse + [])) + (IfE (VarE "compare_len") + (AppE "cmp" + [] + [LitE 0, + VarE "len1", + VarE "word1", + VarE "word2"]) + (PrimAppE MkFalse + [])))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (checkBlogID, + FunDef {funName = "checkBlogID", + funArgs = [id,val], + funTy = ForAll [] + (ArrowTy [PackedTy "BlogId" [], + IntTy] + BoolTy), + funBody = CaseE (VarE "id") + [("ID", + [(x, MetaTv $43)], + IfE (PrimAppE EqIntP + [VarE "x", + VarE "val"]) + (PrimAppE MkTrue []) + (PrimAppE MkFalse []))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkListFiles, + FunDef {funName = "mkListFiles", + funArgs = [f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,len], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy,IntTy] + (PackedTy "PList" + [VectorTy CharTy])), + funBody = IfE (PrimAppE LtP [VarE "len",LitE 0]) + (DataConE (MetaTv $37) "Nil" []) + (LetE (f, + [], + MetaTv $40, + AppE "getFile" + [] + [VarE "f1",VarE "f2", + VarE "f3",VarE "f4", + VarE "f5",VarE "f6", + VarE "f7",VarE "f8", + VarE "f9",VarE "f10", + VarE "len"]) + (LetE (rst, + [], + MetaTv $39, + AppE "mkListFiles" + [] + [VarE "f1", + VarE "f2", + VarE "f3", + VarE "f4", + VarE "f5", + VarE "f6", + VarE "f7", + VarE "f8", + VarE "f9", + VarE "f10", + PrimAppE SubP + [VarE "len", + LitE 1]]) + (DataConE (MetaTv $38) + "Cons" + [VarE "f", + VarE "rst"]))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (getFile, + FunDef {funName = "getFile", + funArgs = [f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,select], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy, + VectorTy CharTy,IntTy] + (VectorTy CharTy)), + funBody = IfE (PrimAppE EqIntP + [VarE "select",LitE 0]) + (VarE "f1") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 1]) + (VarE "f2") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 2]) + (VarE "f3") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 3]) + (VarE "f4") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 4]) + (VarE "f5") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 5]) + (VarE "f6") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 6]) + (VarE "f7") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 7]) + (VarE "f8") + (IfE (PrimAppE EqIntP + [VarE "select", + LitE 8]) + (VarE "f9") + (VarE "f10"))))))))), + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkBlogTags, + FunDef {funName = "mkBlogTags", + funArgs = [taglist], + funTy = ForAll [] + (ArrowTy [PackedTy "PList" + [VectorTy CharTy]] + (PackedTy "BlogTags" [])), + funBody = DataConE (MetaTv $14) + "TagList" + [VarE "taglist"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkBlogContent, + FunDef {funName = "mkBlogContent", + funArgs = [block], + funTy = ForAll [] + (ArrowTy [PackedTy "Block" []] + (PackedTy "BlogContent" + [])), + funBody = DataConE (MetaTv $12) + "Content" + [VarE "block"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkBlogDate, + FunDef {funName = "mkBlogDate", + funArgs = [text], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy] + (PackedTy "BlogDate" [])), + funBody = DataConE (MetaTv $10) + "Date" + [VarE "text"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkBlogAuthor, + FunDef {funName = "mkBlogAuthor", + funArgs = [text], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy] + (PackedTy "BlogAuthor" + [])), + funBody = DataConE (MetaTv $8) + "Author" + [VarE "text"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkBlogID, + FunDef {funName = "mkBlogID", + funArgs = [val], + funTy = ForAll [] + (ArrowTy [IntTy] + (PackedTy "BlogId" [])), + funBody = DataConE (MetaTv $6) "ID" [VarE "val"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkBlogHeader, + FunDef {funName = "mkBlogHeader", + funArgs = [text], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy] + (PackedTy "BlogHeader" + [])), + funBody = DataConE (MetaTv $4) + "Header" + [VarE "text"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (getRandomString, + FunDef {funName = "getRandomString", + funArgs = [length], + funTy = ForAll [] + (ArrowTy [IntTy] (VectorTy CharTy)), + funBody = AppE "generate" + [] + [VarE "length",VarE "mkChar"], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}}), + (mkChar, + FunDef {funName = "mkChar", + funArgs = [val], + funTy = ForAll [] (ArrowTy [IntTy] CharTy), + funBody = AppE "getChar" + [] + [PrimAppE ModP + [PrimAppE RandP [], + LitE 26]], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}})], + mainExp = Nothing}) + [ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 4 1 4 22, srcInfoPoints = [SrcSpan ".hs" 4 1 4 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 4 8 4 22, srcInfoPoints = []}) "Gibbon.Prelude", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}, + ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 5 1 5 20, srcInfoPoints = [SrcSpan ".hs" 5 1 5 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 5 8 5 20, srcInfoPoints = []}) "Gibbon.PList", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}, + ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 6 1 6 21, srcInfoPoints = [SrcSpan ".hs" 6 1 6 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 6 8 6 21, srcInfoPoints = []}) "Gibbon.Vector", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}]] + (ProgModule "Main" + (Prog + {ddefs = [], + fundefs = [(emphKeywordInContent, + FunDef {funName = "emphKeywordInContent", + funArgs = [keyword,blogs], + funTy = ForAll [] + (ArrowTy [VectorTy CharTy, + PackedTy "Blog" []] + (PackedTy "Blog" [])), + funBody = CaseE (VarE "blogs") + [("End", + [], + DataConE (MetaTv $2) "End" []), + ("Layout1", + [(header, MetaTv $8), + (id, MetaTv $9), + (author, MetaTv $10), + (date, MetaTv $11), + (content, MetaTv $12), + (tags, MetaTv $13), + (rst, MetaTv $14)], + LetE (newContent, + [], + MetaTv $7, + CaseE (VarE "content") + [("Content", + [(block, + MetaTv $6)], + DataConE (MetaTv $5) + "Content" + [AppE "emphasizeKeywordInBlock" + [] + [VarE "keyword", + VarE "block"]])]) + (LetE (newRst, + [], + MetaTv $4, + AppE "emphKeywordInContent" + [] + [VarE "keyword", + VarE "rst"]) + (DataConE (MetaTv $3) + "Layout1" + [VarE "header", + VarE "id", + VarE "author", + VarE "date", + VarE "newContent", + VarE "tags", + VarE "newRst"])))], + funMeta = FunMeta {funRec = NotRec, + funInline = NoInline, + funCanTriggerGC = False, + funOptLayout = NoLayoutOpt, + userConstraintsDataCon = Nothing}})], + mainExp = Just (LetE (blogs, + [], + MetaTv $17, + AppE "mkBlogs_layout1" [] [LitE 1000]) + (LetE (keyword, + [], + VectorTy CharTy, + LetE (vec16, + [], + VectorTy CharTy, + PrimAppE (VAllocP CharTy) [LitE 1]) + (LetE (_, + [], + VectorTy CharTy, + PrimAppE (InplaceVUpdateP CharTy) + [VarE "vec16",LitE 0, + CharE 'a']) + (VarE "vec16"))) + (LetE (newblgs, + [], + MetaTv $15, + AppE "emphKeywordInContent" + [] + [VarE "keyword",VarE "blogs"]) + (PrimAppE EqIntP + [AppE "blogLength" + [] + [VarE "newblgs"], + LitE 1000]))), + MetaTv $18)}) + [ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 2 1 2 14, srcInfoPoints = [SrcSpan ".hs" 2 1 2 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 2 8 2 14, srcInfoPoints = []}) "Basics", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}, + ImportDecl {importAnn = SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 3 1 3 23, srcInfoPoints = [SrcSpan ".hs" 3 1 3 7]}, importModule = ModuleName (SrcSpanInfo {srcInfoSpan = SrcSpan ".hs" 3 8 3 23, srcInfoPoints = []}) "GenerateLayout1", importQualified = False, importSrc = False, importSafe = False, importPkg = Nothing, importAs = Nothing, importSpecs = Nothing}]) +gibbon: PackedTy doesn't match PackedTy "PList91" [PackedTy "Block150" []] with PackedTy "Block150" [] +CallStack (from HasCallStack): + error, called at src/Gibbon/L0/Typecheck.hs:884:24 in gibbon-0.3-inplace:Gibbon.L0.Typecheck diff --git a/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.ans b/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.ans index b62065a49..22fa3c6f5 100644 --- a/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.ans +++ b/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.ans @@ -1 +1 @@ -(Layout1 ->i (Header Vector) ->i (ID 8) ->i (Author Vector) ->i (Date Vector) (Content (Plain (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 (Emph (Cons_v_1062 ->i (Str Vector) (Nil_v_1062))) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->r ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 (Emph (Cons_v_1062 ->i (Str Vector) (Nil_v_1062))) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Nil_v_1062))))))))))))))))))))))))))))))))))))))))))))))))))))) ->i (TagList (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Nil_v_1063)))))))))))) (Layout1 ->i (Header Vector) ->i (ID 9) ->i (Author Vector) ->i (Date Vector) (Content (Plain (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 (Emph (Cons_v_1062 ->i (Str Vector) (Nil_v_1062))) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Cons_v_1062 ->i (Str Vector) (Nil_v_1062))))))))))))))))))))))))))))))))))))))))))))))))))))) ->i (TagList (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Cons_v_1063 Vector (Nil_v_1063)))))))))))) (End)))'#() +(Layout1160 ->i (Header173 Vector) ->i (ID172 8) ->i (Author171 Vector) ->i (Date170 Vector) (Content169 (Plain174 (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 (Emph177 (Cons94_v1221 ->i (Str176 Vector) (Nil93_v1221))) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->r ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 (Emph177 (Cons94_v1221 ->i (Str176 Vector) (Nil93_v1221))) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Nil93_v1221))))))))))))))))))))))))))))))))))))))))))))))))))))) ->i (TagList168 (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Nil93_v1222)))))))))))) (Layout1160 ->i (Header173 Vector) ->i (ID172 9) ->i (Author171 Vector) ->i (Date170 Vector) (Content169 (Plain174 (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 (Emph177 (Cons94_v1221 ->i (Str176 Vector) (Nil93_v1221))) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Cons94_v1221 ->i (Str176 Vector) (Nil93_v1221))))))))))))))))))))))))))))))))))))))))))))))))))))) ->i (TagList168 (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Cons94_v1222 Vector (Nil93_v1222)))))))))))) (End159)))'#() \ No newline at end of file diff --git a/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.hs b/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.hs index a01d21fb5..80d8d6d10 100644 --- a/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.hs +++ b/gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.hs @@ -18,4 +18,4 @@ gibbon_main = keyword :: Vector Char keyword = "a" newblgs = emphKeywordInContent keyword blogs - in printPacked newblgs + in printBlog newblgs diff --git a/gibbon-compiler/examples/layout_bench/manyFuncs.hs b/gibbon-compiler/examples/layout_bench/manyFuncs.hs index 6e0527659..0354a3ee7 100644 --- a/gibbon-compiler/examples/layout_bench/manyFuncs.hs +++ b/gibbon-compiler/examples/layout_bench/manyFuncs.hs @@ -12,6 +12,14 @@ emphKeywordInContent keyword blogs = Content block -> Content (emphasizeKeywordInBlock keyword block) newRst = emphKeywordInContent keyword rst in Layout1 header id author date newContent tags newRst + Layout2 content tags rst header id author date -> let newContent = case content of + Content block -> Content (emphasizeKeywordInBlock keyword block) + newRst = emphKeywordInContent keyword rst + in Layout2 content tags newRst header id author date + Layout4 tags content rst header id author date -> let newContent = case content of + Content block -> Content (emphasizeKeywordInBlock keyword block) + newRst = emphKeywordInContent keyword rst + in Layout4 tags content newRst header id author date @@ -23,6 +31,17 @@ filterByKeywordInTagList keyword blogs = case blogs of let newRst = filterByKeywordInTagList keyword rst in Layout4 tags content newRst header id author date else filterByKeywordInTagList keyword rst + Layout2 content tags rst header id author date -> let present = searchBlogTags keyword tags + in if present then + let newRst = filterByKeywordInTagList keyword rst + in Layout4 tags content newRst header id author date + else filterByKeywordInTagList keyword rst + Layout4 tags content rst header id author date -> let present = searchBlogTags keyword tags + in if present then + let newRst = filterByKeywordInTagList keyword rst + in Layout4 tags content newRst header id author date + else filterByKeywordInTagList keyword rst + emphKeywordInTag :: Text -> Blog -> Blog @@ -37,6 +56,25 @@ emphKeywordInTag keyword blogs = case blogs of else let newRst = emphKeywordInTag keyword rst in Layout1 header id author date content tags newRst + Layout2 content tags rst header id author date -> let present = searchBlogTags keyword tags + in if (present) + then let newContent = case content of + Content block -> Content (emphasizeKeywordInBlock keyword block) + newRst = emphKeywordInTag keyword rst + in Layout2 content tags newRst header id author date + else + let newRst = emphKeywordInTag keyword rst + in Layout2 content tags newRst header id author date + Layout4 tags content rst header id author date -> let present = searchBlogTags keyword tags + in if (present) + then let newContent = case content of + Content block -> Content (emphasizeKeywordInBlock keyword block) + newRst = emphKeywordInTag keyword rst + in Layout4 tags content newRst header id author date + else + let newRst = emphKeywordInTag keyword rst + in Layout4 tags content newRst header id author date + -- main function @@ -47,4 +85,4 @@ gibbon_main = newblgs = emphKeywordInContent keyword blogs newblgs' = emphKeywordInTag keyword newblgs newblgs'' = filterByKeywordInTagList keyword newblgs' - in printPacked newblgs'' + in printBlog newblgs'' diff --git a/gibbon-compiler/examples/layout_bench/manyFuncsGlobal.ans b/gibbon-compiler/examples/layout_bench/manyFuncsGlobal.ans index 338363cd1..d55b6449f 100644 --- a/gibbon-compiler/examples/layout_bench/manyFuncsGlobal.ans +++ b/gibbon-compiler/examples/layout_bench/manyFuncsGlobal.ans @@ -1 +1 @@ -(Layout4 ->i ->i ->i (TagList (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Nil_v_1132)))))))))))) ->i (Content (Plain (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) ->r (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))))))))))))))))))))))))))))))))))))))))))))))))))))) (Layout4 ->i ->i ->i (TagList (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Nil_v_1132)))))))))))) ->i (Content (Plain (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))))))))))))))))))))))))))))))))))))))))))))))))))))) (End) ->i ->i ->i (Header Vector) ->i ->i ->i (ID 9) ->i ->i ->i (Author Vector) ->i ->i ->i (Date Vector)) ->i ->i ->i (Header Vector) ->i ->i ->i (ID 8) ->i ->i ->i (Author Vector) ->i ->i ->i (Date Vector))'#() +(Layout4198 ->i ->i ->i (TagList203 (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Nil128_v1293)))))))))))) ->i (Content204 (Plain209 (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 (Emph212 (Cons129_v1292 (Emph212 (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))) (Nil128_v1292))) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) ->r (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 (Emph212 (Cons129_v1292 (Emph212 (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))) (Nil128_v1292))) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))))))))))))))))))))))))))))))))))))))))))))))))))))) (Layout4198 ->i ->i ->i (TagList203 (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Nil128_v1293)))))))))))) ->i (Content204 (Plain209 (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 (Emph212 (Cons129_v1292 (Emph212 (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))) (Nil128_v1292))) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))))))))))))))))))))))))))))))))))))))))))))))))))))) (End194) ->i ->i ->i (Header208 Vector) ->i ->i ->i (ID207 9) ->i ->i ->i (Author206 Vector) ->i ->i ->i (Date205 Vector)) ->i ->i ->i (Header208 Vector) ->i ->i ->i (ID207 8) ->i ->i ->i (Author206 Vector) ->i ->i ->i (Date205 Vector))'#() \ No newline at end of file diff --git a/gibbon-compiler/examples/layout_bench/manyFuncsLocal.ans b/gibbon-compiler/examples/layout_bench/manyFuncsLocal.ans index cabe0b9cd..ca249f4fe 100644 --- a/gibbon-compiler/examples/layout_bench/manyFuncsLocal.ans +++ b/gibbon-compiler/examples/layout_bench/manyFuncsLocal.ans @@ -1 +1 @@ -(Layout4 ->i ->i ->i (TagList (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Nil_v_1132)))))))))))) ->i (Content (Plain (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))))))))))))))))))))))))))))))))))))))))))))))))))))) (Layout4 ->i ->i ->i (TagList (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Nil_v_1132)))))))))))) ->i (Content (Plain (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) ->r (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))))))))))))))))))))))))))))))))))))))))))))))))))))) (End) ->i ->i ->i (Header Vector) ->i ->i ->i (ID 9) ->i ->i ->i (Author Vector) ->i ->i ->i (Date Vector)) ->i ->i ->i (Header Vector) ->i ->i ->i (ID 8) ->i ->i ->i (Author Vector) ->i ->i ->i (Date Vector))'#() +(Layout4198 ->i ->i ->i (TagList203 (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Nil128_v1293)))))))))))) ->i (Content204 (Plain209 (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 (Emph212 (Cons129_v1292 (Emph212 (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))) (Nil128_v1292))) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))))))))))))))))))))))))))))))))))))))))))))))))))))) (Layout4198 ->i ->i ->i (TagList203 (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Cons129_v1293 Vector (Nil128_v1293)))))))))))) ->i (Content204 (Plain209 (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 (Emph212 (Cons129_v1292 (Emph212 (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))) (Nil128_v1292))) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) ->r (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 (Emph212 (Cons129_v1292 (Emph212 (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))) (Nil128_v1292))) (Cons129_v1292 ->i (Str211 Vector) (Cons129_v1292 ->i (Str211 Vector) (Nil128_v1292))))))))))))))))))))))))))))))))))))))))))))))))))))) (End194) ->i ->i ->i (Header208 Vector) ->i ->i ->i (ID207 9) ->i ->i ->i (Author206 Vector) ->i ->i ->i (Date205 Vector)) ->i ->i ->i (Header208 Vector) ->i ->i ->i (ID207 8) ->i ->i ->i (Author206 Vector) ->i ->i ->i (Date205 Vector))'#() \ No newline at end of file diff --git a/gibbon-compiler/examples/layout_bench/manyFuncsLocal2.ans b/gibbon-compiler/examples/layout_bench/manyFuncsLocal2.ans new file mode 100644 index 000000000..02c81e513 --- /dev/null +++ b/gibbon-compiler/examples/layout_bench/manyFuncsLocal2.ans @@ -0,0 +1 @@ +(Layout4 ->i ->i ->i (TagList (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Nil_v_1132)))))))))))) ->i (Content (Plain (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) ->r (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))))))))))))))))))))))))))))))))))))))))))))))))))))) (Layout4 ->i ->i ->i (TagList (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Cons_v_1132 Vector (Nil_v_1132)))))))))))) ->i (Content (Plain (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 (Emph (Cons_v_1131 (Emph (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))) (Nil_v_1131))) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Cons_v_1131 ->i (Str Vector) (Nil_v_1131))))))))))))))))))))))))))))))))))))))))))))))))))))) (End) ->i ->i ->i (Header Vector) ->i ->i ->i (ID 9) ->i ->i ->i (Author Vector) ->i ->i ->i (Date Vector)) ->i ->i ->i (Header Vector) ->i ->i ->i (ID 8) ->i ->i ->i (Author Vector) ->i ->i ->i (Date Vector))'#() \ No newline at end of file diff --git a/gibbon-compiler/examples/poly/Poly1.ans b/gibbon-compiler/examples/poly/Poly1.ans index b33d84444..49fb2c177 100644 --- a/gibbon-compiler/examples/poly/Poly1.ans +++ b/gibbon-compiler/examples/poly/Poly1.ans @@ -1 +1 @@ -'#(10 #t 11 #f 2 4 (Nothing_v_295 ) (Right_v_315 20) (Right_v_306 1) 12 #f 0 3 (Cons_v_301 1(Cons_v_301 2(Nil_v_301 ))) (Cons_v_301 1(Cons_v_301 2(Nil_v_301 ))) (Right_v_306 1) (Cons_v_301 11(Cons_v_301 12(Nil_v_301 )))) \ No newline at end of file +'#(10 #t 11 #f 2 4 (Nothing99_v323) (Right98_v342 20) (Right98_v334 1) 12 #f 0 3 (Cons96_v329 1 (Cons96_v329 2 (Nil95_v329))) (Cons96_v329 1 (Cons96_v329 2 (Nil95_v329))) (Right98_v334 1) (Cons96_v329 11 (Cons96_v329 12 (Nil95_v329)))) \ No newline at end of file diff --git a/gibbon-compiler/examples/test_153.ans b/gibbon-compiler/examples/test_153.ans index 0fd69c661..3bbd24cf0 100644 --- a/gibbon-compiler/examples/test_153.ans +++ b/gibbon-compiler/examples/test_153.ans @@ -1 +1 @@ -'#((A_v_11 2 3) (B_v_12 4 5)) \ No newline at end of file +'#((A6_v15 2 3) (B5_v16 4 5)) \ No newline at end of file diff --git a/gibbon-compiler/examples/test_164.ans b/gibbon-compiler/examples/test_164.ans index ab1492349..31fcf7728 100644 --- a/gibbon-compiler/examples/test_164.ans +++ b/gibbon-compiler/examples/test_164.ans @@ -1 +1 @@ -(Cons_v_46 3 (Cons_v_46 5 (Cons_v_46 7 (Nil_v_46)))) +(Cons19_v50 3 (Cons19_v50 5 (Cons19_v50 7 (Nil18_v50)))) \ No newline at end of file diff --git a/gibbon-compiler/examples/test_166.ans b/gibbon-compiler/examples/test_166.ans index 86a4b2368..663746e89 100644 --- a/gibbon-compiler/examples/test_166.ans +++ b/gibbon-compiler/examples/test_166.ans @@ -1 +1 @@ -(Node_v_54 10 10 10 10 10 10 10 10 (Cell_v_54 5 5 5 5 5 5 5 5) (Cell_v_54 2 2 2 2 2 2 2 2)) +(Node16_v61 10 10 10 10 10 10 10 10 (Cell15_v61 5 5 5 5 5 5 5 5) (Cell15_v61 2 2 2 2 2 2 2 2)) diff --git a/gibbon-compiler/examples/test_191.ans b/gibbon-compiler/examples/test_191.ans index 1828a9fee..18f4f2b04 100644 --- a/gibbon-compiler/examples/test_191.ans +++ b/gibbon-compiler/examples/test_191.ans @@ -1 +1 @@ -(Cons 12 ->i (I 2) (Cons 12 ->i (I 1) (Nil)))'#() +(Cons26 12 ->i (I28 2) (Cons26 12 ->i (I28 1) (Nil27)))'#() \ No newline at end of file diff --git a/gibbon-compiler/examples/test_printpacked.ans b/gibbon-compiler/examples/test_printpacked.ans index 07209292f..55c61c8f0 100644 --- a/gibbon-compiler/examples/test_printpacked.ans +++ b/gibbon-compiler/examples/test_printpacked.ans @@ -1,4 +1,4 @@ -(Node (Node (Leaf 1)(Leaf 1))(Node (Leaf 1)(Leaf 1))) - ->i (Node (Node (Leaf 1)(Leaf 1))(Node (Leaf 1)(Leaf 1))) +(Node32 (Node32 (Leaf31 1)(Leaf31 1))(Node32 (Leaf31 1)(Leaf31 1))) + ->i (Node32 (Node32 (Leaf31 1)(Leaf31 1))(Node32 (Leaf31 1)(Leaf31 1))) 1 '#() \ No newline at end of file diff --git a/gibbon-compiler/src/Gibbon/Common.hs b/gibbon-compiler/src/Gibbon/Common.hs index 895b1fa50..75c320f90 100644 --- a/gibbon-compiler/src/Gibbon/Common.hs +++ b/gibbon-compiler/src/Gibbon/Common.hs @@ -356,10 +356,11 @@ abbrv n x = then str else L.take (n-3) str ++ "..." -lookup3 :: (Eq k, Show k, Show a, Show b) => k -> [(k,a,b)] -> (k,a,b) +lookup3 :: HasCallStack => (Eq k, Show k, Show a, Show b) => k -> [(k,a,b)] -> (k,a,b) lookup3 k ls = go ls where - go [] = error$ "lookup3: key "++show k++" not found in list:\n "++L.take 80 (show ls) + --go [] = error$ "lookup3: key "++show k++" not found in list:\n "++L.take 80 (show ls) + go [] = error$ "lookup3: key "++show k++" not found in list:\n "++ (show ls) go ((k1,a1,b1):r) | k1 == k = (k1,a1,b1) | otherwise = go r diff --git a/gibbon-compiler/src/Gibbon/Compiler.hs b/gibbon-compiler/src/Gibbon/Compiler.hs index 9b992927b..074454c1c 100644 --- a/gibbon-compiler/src/Gibbon/Compiler.hs +++ b/gibbon-compiler/src/Gibbon/Compiler.hs @@ -241,19 +241,28 @@ compile config@Config{mode,input,verbosity,backend,cfile} fp0 = do ----------------------------------------------------------------------------- -- do an early typecheck, before running through the passes or into the interpreter -- perform the minimum transformations for a whole-progrm type-check (freshBundle, bundle, fresh, tc) + ----------------------------------------------------------------------------- - let initTypeChecked :: L0.Prog0 - initTypeChecked = + let initTypeChecked' :: PassM L0.Prog0 + initTypeChecked' = do + bundle <- freshBundleNames l0_bundle + bundle' <- bundleModules bundle + bundle'' <- freshNames bundle' + bundle''' <- L0.tcProg bundle'' + pure bundle''' + let initTypeChecked = fst $ runPassM config 0 initTypeChecked' + {- fst $ runPassM defaultConfig cnt0 (freshBundleNames l0_bundle >>= - (\bundled -> dbgTrace 5 ("\nFreshen:\n"++sepline++ "\n" ++pprender bundled) - (L0.tcProg (fst $ runPassM defaultConfig 0 + (\bundled -> dbgTrace 5 ("\nFreshen:\n" ++ sepline ++ "\n" ++ pprender bundled) + (L0.tcProg (fst $ runPassM defaultConfig 1 (freshNames (fst $ runPassM defaultConfig 0 (bundleModules bundled) )) )) ) ) + -} case mode of -- run via the interpreter on the whole program diff --git a/gibbon-compiler/src/Gibbon/L1/Interp.hs b/gibbon-compiler/src/Gibbon/L1/Interp.hs index bad9dae4f..b9d45b8ec 100644 --- a/gibbon-compiler/src/Gibbon/L1/Interp.hs +++ b/gibbon-compiler/src/Gibbon/L1/Interp.hs @@ -297,6 +297,9 @@ applyPrim rc p args = (PrintSym, [VInt n]) -> do tell $ string8 (show n) pure $ VProd [] + (PrintChar, [c]) -> do + tell $ string8 (show c) + pure $ VProd [] oth -> error $ "unhandled prim or wrong number of arguments: "++show oth where diff --git a/gibbon-compiler/src/Gibbon/Passes/FreshBundle.hs b/gibbon-compiler/src/Gibbon/Passes/FreshBundle.hs index a4c75ffc2..3ee82b41c 100644 --- a/gibbon-compiler/src/Gibbon/Passes/FreshBundle.hs +++ b/gibbon-compiler/src/Gibbon/Passes/FreshBundle.hs @@ -15,7 +15,6 @@ import Language.Haskell.Exts (ModuleName(..), Module, eList) import GHC.Stack (HasCallStack) type VarEnv = M.Map Var Var -type TyVarEnv t = M.Map TyVar t ------------------------------------------------------------------------------- -- exported fresh bundle pass @@ -132,7 +131,7 @@ findFreshInTy ty defenv = findFreshInDataCons :: (DataCon, [(IsBoxed, Ty0)]) -> VarEnv -> (DataCon, [(IsBoxed, Ty0)]) findFreshInDataCons (con, tys) defenv = do - let tys' = map (\(boxed, ty) -> (boxed, (findFreshInTy ty defenv))) tys + let tys' = L.map (\(boxed, ty) -> (boxed, (findFreshInTy ty defenv))) tys (con, tys') findFreshInExp :: Exp0 -> VarEnv -> VarEnv -> VarEnv -> PassM Exp0 @@ -178,7 +177,9 @@ findFreshInExp exp defenv funenv constrenv = CaseE e mp -> do e' <- findFreshInExp e defenv funenv constrenv mp' <- mapM (\(c,prs,ae) -> do - let c' = (fromVar (findFreshedName (toVar c) constrenv)) + let c' = case c of + "_default" -> c + _ -> (fromVar (findFreshedName (toVar c) constrenv)) ae' <- findFreshInExp ae defenv funenv constrenv return (c', prs, ae')) mp return $ CaseE e' mp'