Am Freitag, 22. Juli 2005 15:56 schrieb Mads Lindstrøm:
> Hi Wolfgang
>
> Thank you very much for the reply. I added an extra parameter to the
> function, so the code now looks like:
>
> foo :: (Data a) => a -> Constr -> Int
> foo idType = (numChildren idType) . fromConstr
>
> numChildren ::
Hi Wolfgang
Thank you very much for the reply. I added an extra parameter to the
function, so the code now looks like:
foo :: (Data a) => a -> Constr -> Int
foo idType = (numChildren idType) . fromConstr
numChildren :: (Data a) => a -> a -> Int
numChildren _ x = sum $ gmapQ (\_ -> 1) x
Am Freitag, 22. Juli 2005 14:58 schrieb Mads Lindstrøm:
> Hi
>
> I am struggling with an ambiguity problem. I have the following code:
> > foo :: Constr -> Int
> > foo = numChildren . fromConstr
> >
> > numChildren :: (Data a) => a -> Int
> > numChildren x = sum $ gmapQ (\_ -> 1) x
>
> which I thou
Hi
I am struggling with an ambiguity problem. I have the following code:
> foo :: Constr -> Int
> foo = numChildren . fromConstr
>
> numChildren :: (Data a) => a -> Int
> numChildren x = sum $ gmapQ (\_ -> 1) x
which I thought would work, but the GHC-6.4 says:
> Ambiguous type variable `a' in
2005 Haskell Workshop
Tallinn, Estonia, 30 September, 2005
http://www.cs.uu.nl/~daan/hw2005
Call for participation
-- Important Dates ---
Early registration deadline : July