[Haskell-cafe] Question on rank-N polymorphism

Vladimir Reshetnikov v.reshetnikov at gmail.com
Sat Jun 6 18:06:11 EDT 2009


Hi,

I have the following code:

--------------------------------------------------------------------------------
fs g = (g fst, g snd)
examples = (fs fmap, fs liftA, fs liftM, fs id, fs ($(1,"2")), fs
((,)id), fs (:[]), fs repeat)
--------------------------------------------------------------------------------

The idea is that fs accepts a polymorphic function as its argument.
What type signature can I specify for f in order to compile this code?
If it is not possible in Haskell, is there another language with
static typing which allows this?

Thanks,
Vladimir


More information about the Haskell-Cafe mailing list