<div dir="ltr">Yes, but you have to wrap it up:<br><div><br></div><div><div><font face="monospace, monospace">{-# LANGUAGE RankNTypes #-}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">-- obviously not to useful for this example :)</font></div><div><font face="monospace, monospace">newtype Id = Id (forall a. a -> a)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">f :: IO Id</font></div><div><font face="monospace, monospace">f = return (Id id)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">main = do</font></div><div><font face="monospace, monospace">  Id g <- f</font></div><div><font face="monospace, monospace">  print $ g 1</font></div><div><font face="monospace, monospace">  print $ g "ciao"</font></div></div><div><br></div><div>Can I ask what you're trying to do with this?</div><div><br></div><div>Patrick</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 15, 2015 at 3:11 PM, Paolino <span dir="ltr"><<a href="mailto:paolo.veronelli@gmail.com" target="_blank">paolo.veronelli@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">Hello list, I'm trying to accomplish something along this line<br><div><br>{-# LANGUAGE ScopedTypeVariables #-}<br><br>f :: IO (a -> a)<br>f = return id<br><br>main = do<br>  (g :: a -> a) <- f<br>  print $ g 1<br>  print $ g "ciao"<br><br></div><div><br><br></div><div>Is it possible or I have to call f more than once to get different g's<br><br><br></div><div>Thanks<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>paolino<br></div></font></span></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>