core-spec: Simplify the handling of LetRec
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 18 Apr 2017 20:33:38 +0000 (16:33 -0400)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 24 Apr 2017 20:34:26 +0000 (16:34 -0400)
commit583fa9e3687b49d8c779e6d53a75af9276e4f5cf
treeb677845bc133aeea6ef657ef29c8df716acda623
parentcd10a23282499b474cedeb4f63f92e70ed9718f3
core-spec: Simplify the handling of LetRec

We do not need to keep an enrivonment around to implement letrec, as
long as we only do call-by-name. Instead, evaluate letrec by
substituting for all the variables with their RHS wrapped in the letrec
binding.

Since nothing adds to the enrivonment any more, there is no need for a
S_Var rule.

Differential Revision: https://phabricator.haskell.org/D3466
docs/core-spec/OpSem.ott
docs/core-spec/core-spec.mng
docs/core-spec/core-spec.pdf