Re: [Haskell-cafe] Ambiguous type variable woes

2008-11-24 Thread Andrea Vezzosi
If you want to defer the choice of 's' you've to make it appear in the type signature of test1, so you've to introduce an artificial parameter even if we're interested only in its type. e.g.: data Proxy (s :: * - * - *) -- useful because we can't have an argument of type 's' directly, since it's

[Haskell-cafe] Ambiguous type variable woes

2008-11-23 Thread Jacques Carette
I was trying to create a typeclass for an abstract Stack class, and ran into some problems. The following 'works' fine: {-# OPTIONS_GHC -XEmptyDataDecls -XFlexibleContexts -fno-monomorphism-restriction #-} module Stack where data Void class Stack s where push_ :: s a r - b - s b (s a r)