-
Notifications
You must be signed in to change notification settings - Fork 0
/
Prelude.ast.hs
2 lines (2 loc) · 6.38 KB
/
Prelude.ast.hs
1
2
import AST.AST
ast=Mod "Prelude" ["Prelude.lol","Prelude.exampleProgram","Prelude.prog","Prelude.example"] [] [Fun "Prelude.arity0" (Just (TApp (TApp (TCon "Prim.->") (TCon "Prim.String")) (TApp (TApp (TCon "Prim.->") (TCon "Prim.String")) (TApp (TApp (TCon "Prim.->") (TCon "Prelude.T0")) (TVar "a"))))) (ELambda [PVar "mod",PVar "fun"] (EApp (EApp (EApp (EApp (EApp (EVar "Prim.apply") (ELit (LS "Prim"))) (ELit (LS "arity0toArity1"))) (ELit (LI 2))) (EVar "mod")) (EVar "fun"))),Fun "Prelude.bind" (Just (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.IO") (TVar "a"))) (TApp (TApp (TCon "Prim.->") (TApp (TApp (TCon "Prim.->") (TVar "a")) (TApp (TCon "Prelude.IO") (TVar "b")))) (TApp (TCon "Prelude.IO") (TVar "b"))))) (ELambda [PVar "io",PVar "f"] (EApp (EVar "Prelude.mkIO") (ELambda [PWild] (EApp (EVar "Prelude.runIO") (EApp (EVar "f") (EApp (EVar "Prelude.runIO") (EVar "io"))))))),Fun "Prelude.coerce" (Just (TApp (TApp (TCon "Prim.->") (TVar "a")) (TVar "b"))) (ELambda [PVar "x"] (EApp (EApp (EApp (EApp (EVar "Prim.apply") (ELit (LS "Prim"))) (ELit (LS "coerce"))) (ELit (LI 1))) (EVar "x"))),Fun "Prelude.example" Nothing (EApp (EVar "Prelude.show") (ECon "Prelude.Tue")),Fun "Prelude.exampleProgram" Nothing (EApp (EApp (EVar "Prelude.bind") (EVar "Prelude.self")) (EVar "Prelude.fun1")),Fun "Prelude.fun1" Nothing (ELambda [PVar "s"] (EApp (EApp (EVar "Prelude.bind") (EApp (EApp (EVar "Prelude.send") (EVar "s")) (ECon "Prelude.T"))) (EVar "Prelude.fun2"))),Fun "Prelude.fun2" Nothing (ELambda [PVar "_arg1"] (ECase (ETuple [EVar "_arg1"]) [(PTuple [PWild],ECase (EVar "Prelude.receive") [(PVar "b",EApp (EApp (EVar "Prelude.isBool") (EVar "b")) (EApp (EVar "Prelude.io_format") (ELit (LS "Got a list of numbers!")))),(PCon "Prelude.After" [PCon "Prelude.Timeout" [PLit (LI 3000)]],EApp (EVar "Prelude.io_format") (ELit (LS "huh")))])])),Fun "Prelude.io_format" (Just (TApp (TApp (TCon "Prim.->") (TCon "Prim.String")) (TApp (TCon "Prelude.IO") (TCon "Prim.Atom")))) (ELambda [PVar "s"] (EApp (EVar "Prelude.mkIO") (ELambda [PWild] (EApp (EApp (EApp (EApp (EVar "Prim.apply") (ELit (LS "io"))) (ELit (LS "format"))) (ELit (LI 1))) (EVar "s"))))),Fun "Prelude.isBool" (Just (TApp (TApp (TCon "Prim.->") (TCon "Prelude.Bool")) (TApp (TApp (TCon "Prim.->") (TVar "a")) (TVar "a")))) (ELambda [PWild,PVar "x"] (EVar "x")),Fun "Prelude.isListNumber" (Just (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.List") (TCon "Prim.Number"))) (TApp (TApp (TCon "Prim.->") (TVar "a")) (TVar "a")))) (ELambda [PWild,PVar "x"] (EVar "x")),Fun "Prelude.listNumber" (Just (TApp (TCon "Prelude.List") (TCon "Prim.Number"))) (ECon "Prelude.Nil"),Fun "Prelude.lol" Nothing (EApp (EVar "Prelude.typeOf") (EApp (ECon "Prelude.ConT") (ELit (LS "woop")))),Fun "Prelude.mkIO" (Just (TApp (TApp (TCon "Prim.->") (TApp (TApp (TCon "Prim.->") (TCon "Prelude.T0")) (TVar "a"))) (TApp (TCon "Prelude.IO") (TVar "a")))) (ELambda [PVar "f"] (EApp (EVar "Prelude.coerce") (EVar "f"))),Fun "Prelude.prog" Nothing (ELambda [PVar "pid"] (EApp (EApp (EVar "Prelude.send") (EVar "pid")) (ECon "Prelude.T"))),Fun "Prelude.runIO" (Just (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.IO") (TVar "a"))) (TVar "a"))) (ELambda [PVar "io"] (EApp (EApp (EVar "Prelude.coerce") (EVar "io")) (ECon "Prelude.T0"))),Fun "Prelude.sametype" (Just (TApp (TApp (TCon "Prim.->") (TVar "a")) (TApp (TApp (TCon "Prim.->") (TVar "a")) (TVar "a")))) (ELambda [PVar "x",PVar "y"] (EVar "x")),Fun "Prelude.self" (Just (TApp (TCon "Prelude.IO") (TCon "Prim.Pid"))) (EApp (EVar "Prelude.mkIO") (EApp (EApp (EVar "Prelude.arity0") (ELit (LS "erlang"))) (ELit (LS "self")))),Fun "Prelude.send" (Just (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.Implicit") (TVar "t"))) (TApp (TApp (TCon "Prim.->") (TCon "Prim.Pid")) (TApp (TApp (TCon "Prim.->") (TVar "t")) (TApp (TCon "Prelude.IO") (TVar "t")))))) (ELambda [PVar "type",PVar "pid",PVar "message"] (EApp (EVar "Prelude.mkIO") (ELambda [PWild] (EApp (EApp (EApp (EApp (EApp (EVar "Prim.apply") (ELit (LS "erlang"))) (ELit (LS "!"))) (ELit (LI 2))) (EVar "pid")) (EApp (EApp (ECon "Prelude.T2") (EVar "type")) (EVar "message")))))),Fun "Prelude.show" (Just (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.Implicit") (TVar "x"))) (TApp (TApp (TCon "Prim.->") (TVar "x")) (TCon "Prim.String")))) (ELambda [PCon "Prelude.ConT" [PLit (LS "Prelude.Boll")],PVar "x"] (ECase (EApp (EVar "Prelude.coerce") (EVar "x")) [(PCon "Prelude.Tue" [],ELit (LS "Tue")),(PCon "Prelude.Fale" [],ELit (LS "Fale"))])),Fun "Prelude.spawn" (Just (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.IO") (TVar "a"))) (TApp (TCon "Prelude.IO") (TCon "Prim.Pid")))) (ELambda [PVar "io"] (EApp (EApp (EApp (EApp (EVar "Prim.apply") (ELit (LS "Prim"))) (ELit (LS "primSpawn"))) (ELit (LI 1))) (EVar "io"))),Fun "Prelude.typeOf" (Just (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.Implicit") (TVar "t"))) (TApp (TApp (TCon "Prim.->") (TVar "t")) (TCon "Prelude.Type")))) (ELambda [PVar "t",PWild] (EVar "t"))] (fromList [("False",TCon "Prelude.Bool"),("Prelude.AppT",TApp (TApp (TCon "Prim.->") (TCon "Prelude.Type")) (TApp (TApp (TCon "Prim.->") (TCon "Prelude.Type")) (TCon "Prelude.Type"))),("Prelude.ConT",TApp (TApp (TCon "Prim.->") (TCon "Prim.String")) (TCon "Prelude.Type")),("Prelude.Cons",TApp (TApp (TCon "Prim.->") (TVar "a")) (TApp (TApp (TCon "Prim.->") (TApp (TCon "Prelude.List") (TVar "a"))) (TApp (TCon "Prelude.List") (TVar "a")))),("Prelude.F",TCon "Prelude.Bool"),("Prelude.Fale",TCon "Prelude.Boll"),("Prelude.Infinity",TCon "Prelude.Timeout"),("Prelude.Nil",TApp (TCon "Prelude.List") (TVar "a")),("Prelude.NoConIO",TApp (TCon "Prelude.IO") (TVar "a")),("Prelude.T",TCon "Prelude.Bool"),("Prelude.T0",TCon "Prelude.T0"),("Prelude.T2",TApp (TApp (TCon "Prim.->") (TVar "a")) (TApp (TApp (TCon "Prim.->") (TVar "b")) (TApp (TApp (TCon "Prelude.T2") (TVar "b")) (TVar "a")))),("Prelude.T3",TApp (TApp (TCon "Prim.->") (TVar "a")) (TApp (TApp (TCon "Prim.->") (TVar "b")) (TApp (TApp (TCon "Prim.->") (TVar "c")) (TApp (TApp (TApp (TCon "Prelude.T3") (TVar "c")) (TVar "b")) (TVar "a"))))),("Prelude.T4",TApp (TApp (TCon "Prim.->") (TVar "a")) (TApp (TApp (TCon "Prim.->") (TVar "b")) (TApp (TApp (TCon "Prim.->") (TVar "c")) (TApp (TApp (TCon "Prim.->") (TVar "d")) (TApp (TApp (TApp (TApp (TCon "Prelude.T4") (TVar "d")) (TVar "c")) (TVar "b")) (TVar "a")))))),("Prelude.Timeout",TApp (TApp (TCon "Prim.->") (TCon "Prim.Number")) (TCon "Prelude.Timeout")),("Prelude.Tue",TCon "Prelude.Boll"),("True",TCon "Prelude.Bool")])