Type Problem

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
16 Sep 2001 09:44:08 GMT


Sun, 16 Sep 2001 16:28:01 +0800 (GMT-8), Saswat Anand <saswatan@comp.nus.edu.sg> pisze:

> trickyFun fun = let x = fun (2::Int)       -----------(1)
> 		    y = fun 'c'            -----------(2)
> 		in "tricky" 

It can't be done this way in standard Haskell.

In GHC and Hugs you can use local universal quantifaction
by writing explicit type signature: 

trickyFun :: (forall a. X a => a -> b) -> String

GHC needs to be run with -fglasgow-exts, Hugs needs -98.

GHC user's guide describes some limitations, e.g. trickyFun must
always be directly applied to an argument.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK