
On Wed, Nov 05, 2003 at 09:13:12PM +0100, Stefan Reich wrote:
Hi,
I discovered implicit parameters today and I'm very excited about them because they allow to express certain code constructs more elegantly. However, I stumbled upon a problem. Suppose I have these definitions (the definition of Request is irrelevant):
type Controller = (?req :: Request) => String
controller1 :: Controller controller2 :: Controller
controllerList = [controller1, controller2]
GHC complains with:
Unbound implicit parameter (?req :: Request) arising from use of `controller1' In the list element: controller1 In the definition of `controllerList': controllerList = [controller1, controller2]
You have just been bitten by monomorphism restriction. Write a type signature for controllerList and it should work: controllerList :: (?req :: Request) => [String] Best regards, Tom -- .signature: Too many levels of symbolic links