[Haskell-cafe] Solved but strange error in type inference

Yves Parès limestrael at gmail.com
Tue Jan 3 18:07:15 CET 2012


Brent is right. Separating functions is nicer to read and cleaner. Plus it
enhances testability.

> I wonder why the redeclared type variables cannot match those of legSome?
Try to put a totally wrong type to subsome, like
subsome :: Int
and tell us from the error what type is actually inferred.

2012/1/3 Yucheng Zhang <yczhang89 at gmail.com>

> On Wed, Jan 4, 2012 at 12:44 AM, Yves Parès <limestrael at gmail.com> wrote:
> > Remove subsome type signature. You are redeclaring type variables which
> > obviously cannot match those of legSome.
> > This cannot work without scoped type variables (and ad-hoc foralls to
> bring
> > them to scope, of course).
>
> That subsome type signature is from the original code.
>
> I wonder why the redeclared type variables cannot match those of legSome?
>
>
>
>
> p.s. I just realized that my changed code missed the line:
>
> > import qualified Data.Map as M
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120103/7eaa0650/attachment.htm>


More information about the Haskell-Cafe mailing list