<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 7, 2016 at 2:56 PM, Michael Roth <span dir="ltr"><<a href="mailto:list@mroth.net" target="_blank">list@mroth.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> as = someGenerator s<br>
bs = drop 1000000000 (someGenerator s)<br><br>
Is it guaranteed that 'someGenerator s' is created twice and not shared between 'as' and 'bs'? Is this by language design? Are there any GHC options that change the behaviour?<br></blockquote></div><div class="gmail_extra"><br></div>It's not specified in any standard, but ghc will only share something that is directly bound. There is no sensible way to determine sharing automatically that will do what everyone expects, so ghc doesn't try: the programmer is expected to use bindings to specify sharing.<br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a> <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div></div>