In answering a question on stackoverflow, I noticed that GHCi (interactive) is assigning a too-restrictive type in a let statement. Namely, given the code,<
See the extended defaulting rules used in GHCi for an explanation of where the ()
is coming from.
As for why the defaulting occurs in this case, compare the following:
> let f x = maximum &&& id >>> fst &&& (\(m,l) -> length $ filter (==m) l) $ x
> :t f
f :: (Ord a) => [a] -> (a, Int)
I assume this has something to do with bindings being monomorphic, but I'm not certain of the details.