Skip to content

Instantly share code, notes, and snippets.

@osa1
Created March 28, 2013 13:22
Show Gist options
  • Save osa1/5263085 to your computer and use it in GitHub Desktop.
Save osa1/5263085 to your computer and use it in GitHub Desktop.
# typstr "run((fun c -> <(let x = 1 in ~c, let y = 1 in ~c)>) <0>);;";;
typ <-- [0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <--
RunE
(AppE
(AbsE
(Abs ("c",
BoxE
(PairE
(LetInE (Valbind ("x", ConstE (CInt 1)), UnboxE (IdE "c")),
LetInE (Valbind ("y", ConstE (CInt 1)), UnboxE (IdE "c")))))),
BoxE (ConstE (CInt 0))))
typ <-- [0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <--
AppE
(AbsE
(Abs ("c",
BoxE
(PairE
(LetInE (Valbind ("x", ConstE (CInt 1)), UnboxE (IdE "c")),
LetInE (Valbind ("y", ConstE (CInt 1)), UnboxE (IdE "c")))))),
BoxE (ConstE (CInt 0)))
typ <-- [0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <--
AbsE
(Abs ("c",
BoxE
(PairE
(LetInE (Valbind ("x", ConstE (CInt 1)), UnboxE (IdE "c")),
LetInE (Valbind ("y", ConstE (CInt 1)), UnboxE (IdE "c"))))))
typ <-- [0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <--
BoxE
(PairE
(LetInE (Valbind ("x", ConstE (CInt 1)), UnboxE (IdE "c")),
LetInE (Valbind ("y", ConstE (CInt 1)), UnboxE (IdE "c"))))
typ <-- [0; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <--
PairE
(LetInE (Valbind ("x", ConstE (CInt 1)), UnboxE (IdE "c")),
LetInE (Valbind ("y", ConstE (CInt 1)), UnboxE (IdE "c")))
typ <-- [0; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- LetInE (Valbind ("x", ConstE (CInt 1)), UnboxE (IdE "c"))
typ <-- [1; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- ConstE (CInt 1)
typ** --> TInt
typ <-- [0; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- UnboxE (IdE "c")
typ <-- [0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- IdE "c"
typ** --> TVar {contents = (NoLink "abe", 0)}
typ** --> TVar {contents = (NoLink "abs", 0)}
typ** --> TVar {contents = (NoLink "abs", 0)}
typ <-- [0; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- LetInE (Valbind ("y", ConstE (CInt 1)), UnboxE (IdE "c"))
typ <-- [1; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- ConstE (CInt 1)
typ** --> TInt
typ <-- [0; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- UnboxE (IdE "c")
typ <-- [0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- IdE "c"
typ** -->
TVar
{contents =
(LinkTo
(TBox
(Row ("x", FieldType TInt,
Rho
{contents =
(LinkTo
(Row ("y", FieldVar {contents = (NoLink "abu", 0)},
Rho {contents = (NoLink "abw", 0, <abstr>)})),
0, <abstr>)}),
TVar {contents = (NoLink "abs", 0)})),
0)}
typ** --> TVar {contents = (LinkTo (TVar {contents = (NoLink "abs", 0)}), 0)}
typ** --> TVar {contents = (LinkTo (TVar {contents = (NoLink "abs", 0)}), 0)}
typ** -->
TPair (TVar {contents = (NoLink "abs", 0)},
TVar {contents = (LinkTo (TVar {contents = (NoLink "abs", 0)}), 0)})
typ** -->
TBox
(Rho
{contents =
(LinkTo
(Row ("x", FieldVar {contents = (LinkTo (FieldType TInt), 0)},
Rho
{contents =
(LinkTo
(Row ("y",
FieldVar {contents = (LinkTo (FieldType TInt), 0)},
Rho {contents = (NoLink "abw", 0, <abstr>)})),
0, <abstr>)})),
0, <abstr>)},
TPair (TVar {contents = (NoLink "abs", 0)},
TVar {contents = (LinkTo (TVar {contents = (NoLink "abs", 0)}), 0)}))
typ** -->
TFun
(TVar
{contents =
(LinkTo
(TBox
(Row ("x", FieldType TInt,
Rho
{contents =
(LinkTo
(Row ("y",
FieldVar {contents = (LinkTo (FieldType TInt), 0)},
Rho {contents = (NoLink "abw", 0, <abstr>)})),
0, <abstr>)}),
TVar {contents = (NoLink "abs", 0)})),
0)},
TBox
(Rho
{contents =
(LinkTo
(Row ("x", FieldVar {contents = (LinkTo (FieldType TInt), 0)},
Rho
{contents =
(LinkTo
(Row ("y",
FieldVar {contents = (LinkTo (FieldType TInt), 0)},
Rho {contents = (NoLink "abw", 0, <abstr>)})),
0, <abstr>)})),
0, <abstr>)},
TPair (TVar {contents = (NoLink "abs", 0)},
TVar {contents = (LinkTo (TVar {contents = (NoLink "abs", 0)}), 0)})))
typ <-- [0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- BoxE (ConstE (CInt 0))
typ <-- [0; 0]
typ --> <fun>
typ* <--
env
typ* --> <fun>
typ** <-- ConstE (CInt 0)
typ** --> TInt
typ** --> TBox (Rho {contents = (NoLink "adq", 0, <abstr>)}, TInt)
typ** -->
TVar
{contents =
(LinkTo
(TBox
(Rho
{contents =
(LinkTo
(Row ("x", FieldVar {contents = (LinkTo (FieldType TInt), 0)},
Rho
{contents =
(LinkTo
(Row ("y",
FieldVar {contents = (LinkTo (FieldType TInt), 0)},
Rho {contents = (NoLink "abw", 0, <abstr>)})),
0, <abstr>)})),
0, <abstr>)},
TPair (TVar {contents = (LinkTo TInt, 0)},
TVar {contents = (LinkTo TInt, 0)}))),
0)}
typ** -->
TVar
{contents =
(LinkTo
(TPair (TVar {contents = (LinkTo TInt, 0)},
TVar {contents = (LinkTo TInt, 0)})),
0)}
- : StagedTypes.ty =
TVar
{contents =
(LinkTo
(TPair (TVar {contents = (LinkTo TInt, 0)},
TVar {contents = (LinkTo TInt, 0)})),
0)}
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment