[Haskell-cafe] Quite confused by simple transformations on this
code not working
wagner.andrew at gmail.com
Tue Jan 20 23:22:04 EST 2009
So...there's just no good way to avoid the duplication?
On Tue, Jan 20, 2009 at 11:10 PM, wren ng thornton <wren at freegeek.org>wrote:
> Andrew Wagner wrote:
>> Strange little bit of code:
>> If I do any of the following, all of which seem natural to me, it fails to
>> 1. move f out of the 'where' clause (with or without a type signature)
>> 2. put the same type signature on f as is on (/\)
>> 3. replace f with (/\) completely
>> What's going on here?
> > :t (nub .) . (++)
> (nub .) . (++) :: (Eq a) => [a] -> [a] -> [a]
> > :t foldr (map . (nub .) . (++))
> foldr (map . (nub .) . (++)) :: (Eq a) => [[a]] -> [[a]] -> [[a]]
> The type you give to (/\) is more restrictive than the type of the
> expression, and f uses the generality of the expression.
> Live well,
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe