<div> </div>
<div>Many thanks for your helps.</div>
<div> </div>
<div>Kwanghoon</div>
<div> </div>
<div>On Tue, Dec 16, 2008 at 11:22 PM, Thomas Schilling <span dir="ltr"><<a href="mailto:nominolo@googlemail.com">nominolo@googlemail.com</a>></span> wrote:<br></div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">{-# LANGUAGE ScopedTypeVariables #-}<br><br>2008/12/16 Neil Mitchell <<a href="mailto:ndmitchell@gmail.com">ndmitchell@gmail.com</a>>:<br>
<div>
<div></div>
<div class="Wj3C7c">> Hi<br>><br>>> You want to use `asTypeOf`, with a lazy pattern to name a value of type 'a'.<br>>><br>>> pr xs = "[" ++ pr (undefined `asTypeOf` x) ++ "]"<br>
>> where (x:_) = xs<br>><br>> I prefer:<br>><br>> pr xs = "[" ++ pr (undefined `asTypeOf` head x) ++ "]"<br>><br>> Or even more simply:<br>><br>> pr xs = "[" ++ pr (head x) ++ "]"<br>
><br>> I do believe there is some GHC extension that can be turned on to<br>> refer to variables like you did, but its not standard Haskell.<br>><br>> Thanks<br>><br>> Neil<br>> _______________________________________________<br>
> Glasgow-haskell-users mailing list<br>> <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>> <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
><br><br><br><br></div></div><font color="#888888">--<br>Push the envelope. Watch it bend.<br></font>
<div>
<div></div>
<div class="Wj3C7c">_______________________________________________<br>Glasgow-haskell-users mailing list<br><a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
</div></div></blockquote></div><br>