<div dir="ltr">It's just compatibility with the standard: there might be existing code that depends on Haskell 98 not extending the scope of a type variable, so you need to be explicit about which type variables' scope to extend. "forall" is already there for other extensions, and is otherwise a no-op in this situation, so it's a safe way to specify the extended scope.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 12, 2018 at 4:41 PM, Ryan Reich <span dir="ltr"><<a href="mailto:ryan.reich@gmail.com" target="_blank">ryan.reich@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">I too am curious about the forall in ScopedTypeVariables. It seems formally unnecessary, so I assume it is designed to avert some kind of inconsistency with standard behavior? Thinking about other extensions, e.g. FlexibleInstances or MultiParamTypeClasses, it seems like they all give meaning to constructs that are forbidden by the standard, while this one actually changes the standard behavior (for the better, imho) and so requires protection by some nonstandard signifier, i.e. forall.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Apr 12, 2018 13:27, "Dennis Raddle" <<a href="mailto:dennis.raddle@gmail.com" target="_blank">dennis.raddle@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="m_509717694175469005quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Thanks!<div><br></div><div>By the way, why do I sometimes have to use forall, and sometimes not? </div><div><br></div><div>I'm also learning Purescript, and I noticed that the examples use 'forall' in every case. Why would it be different with Purescript?</div><div class="m_509717694175469005signature-text"><div>D</div></div></div></div></div><div class="m_509717694175469005elided-text"><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 12, 2018 at 12:51 PM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" rel="noreferrer" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span><div class="gmail_quote">On Thu, Apr 12, 2018 at 3:47 PM, Dennis Raddle <span dir="ltr"><<a href="mailto:dennis.raddle@gmail.com" rel="noreferrer" target="_blank">dennis.raddle@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>myFunc :: a -> b -> c</div><div>myFunc x y z = ...</div><div>  where</div><div>    helper :: a -> [b]</div><div>    helper xx = ...</div><div><br></div><div>Notice that I'm attempting to declare 'helper' using my type variables. I've noticed that this results in an error.</div><div>Is this actually possible, and how?</div></div></blockquote></div><div class="gmail_extra"><br></div></span>You need the ScopedTypeVariables extension, *and* to "declare" the type variables whose scope is to be extended with an explicit "forall" in the signature.<span class="m_509717694175469005m_-3321723665971193689HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_509717694175469005m_-3321723665971193689m_1878463950347775658gmail_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" rel="noreferrer" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" rel="noreferrer" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" rel="noreferrer" target="_blank">http://sinenomine.net</a></div></div></div>
</font></span></div></div>
</blockquote></div><br></div></div></div><span class="">
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</span></div></blockquote></div><br></div>
</blockquote></div><br><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>