
On Sun, 01 Jan 2012 05:29:42 -0700, Sebastian Fischer
On Sat, Dec 31, 2011 at 4:09 PM, Kevin Quick
wrote: onVarElem :: forall a . (Show a) => (Maybe a -> String) -> Var -> String
The problem is the scope of the quantification of the type variable 'a'. You can use higher-rank types (via the Rank2Types or RankNTypes language extension) to achieve what you want. Change the type of 'onVarElem' to
onVarElem :: (forall a . (Show a) => Maybe a -> String) -> Var -> String
Thanks to both Sebastian and Sean for the solution (abbreviated from Sebastian's reponse above). -Kevin P.S. Sorry for the late followup: some minor system issues prevented checking email for a little while. The delay notwithstanding, *all* of the responses were much appreciated. -- -KQ