<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 7, 2015 at 7:28 PM, Nikita Kartashov <span dir="ltr"><<a href="mailto:snailandmail@gmail.com" target="_blank">snailandmail@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>Is it possible to use something instead extractA function here? For example, substitute "extractA u” with “undefined :: a”?</div><div>GHC disallows it, so is there a way to explain that I only need a token with type a?</div></blockquote></div><br>It needs a function type there. That said, `const undefined' might work, or even just `undefined', if it can infer the type correctly.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I don't *think* you can use 'a' as a type there meaningfully; IIRC it doesn't scope over the method definition, so `a' would be referring to a new type, not the one in the instance header. The ScopedTypeVariables extension would help, along with InstanceSigs so you can specify a signature for `show` with a `forall' in it to activate the scope. See the example at <a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/type-class-extensions.html#instance-sigs">https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/type-class-extensions.html#instance-sigs</a> for how to do it.</div><div class="gmail_extra"><div><br></div>-- <br><div class="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>