[Haskell-cafe] returning a polymorphic function

Paolino paolo.veronelli at gmail.com
Mon Jun 15 14:11:40 UTC 2015


Hello list, I'm trying to accomplish something along this line

{-# LANGUAGE ScopedTypeVariables #-}

f :: IO (a -> a)
f = return id

main = do
  (g :: a -> a) <- f
  print $ g 1
  print $ g "ciao"



Is it possible or I have to call f more than once to get different g's


Thanks

paolino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150615/da1a6053/attachment.html>


More information about the Haskell-Cafe mailing list