[Haskell-cafe] Solved but strange error in type inference
yczhang89 at gmail.com
Tue Jan 3 18:38:01 CET 2012
On Wed, Jan 4, 2012 at 1:07 AM, Yves Parès <limestrael at gmail.com> wrote:
> Try to put a totally wrong type to subsome, like
> subsome :: Int
> and tell us from the error what type is actually inferred.
The error is like
> Couldn't match type `nt' with `Int'
> `nt' is a rigid type variable bound by
> the type signature for
> legSome :: LegGram nt t s -> nt -> Either String ([t], s)
> at xx.hs:35:1
> Expected type: [RRule Int t s]
> Actual type: [RRule nt t s]
> In the first argument of `subsome', namely `l'
> In the expression: subsome l
However, this error cannot be resolved by a use of ScopedTypeVariable,
while the original error can be resolved.
I still don't see where the mismatch happens in the original error. Any help
More information about the Haskell-Cafe