<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I don't think there is a user-visible difference between treating "a = 1" as a declaration vs as a let. One might be easier to implement.</div><div><br></div><div>My guess is that Austin's thought in that chat log is around MonoLocalBinds. MonoLocalBinds (implied by GADTs and TypeFamilies) means that some let declarations are not generalized. In particular, let declarations that are manifestly *not* top-level. Like this:</div><div><br></div><div>foo x = let y = x in y</div><div><br></div><div>That `y` is manifestly not top-level because its RHS mentions a local variable. So, `y` is not generalized if MonoLocalBinds is in effect.</div><div><br></div><div>But, in GHCi, this matters not. Anything the user writes in a top-level variable assignment can only possibly refer to top-level things, never to local things (because there are no local things). So MonoLocalBinds will not trigger, and treating an assignment as either a declaration or a "let" should have the same meaning.</div><div><br></div><div>Richard</div><br><div><div>On Aug 22, 2015, at 11:50 AM, Alex Rozenshteyn <<a href="mailto:rpglover64@gmail.com">rpglover64@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div>I'm thinking of working on this ticket (<a href="https://ghc.haskell.org/trac/ghc/ticket/7253">https://ghc.haskell.org/trac/ghc/ticket/7253</a>), so, as per mpickering's suggestion (<a href="https://phabricator.haskell.org/chatlog/channel/3/?at=1353572">https://phabricator.haskell.org/chatlog/channel/3/?at=1353572</a>), I'm emailing the list to solicit input.<br><br></div>My first instinct was to treat declarations like "a = 1" in GHCI as equivalent to "let a = 1"; this would be a straightforward matter of parsing. On the other hand, as thoughtpolice comments, let-bound variables are treated subtly differently than top-level bindings, so the proper solution may be more involved.<br><br></div>Comments?<br></div>
_______________________________________________<br>ghc-devs mailing list<br><a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br></blockquote></div><br></body></html>