
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
On Wed, Jan 4, 2012 at 12:44 AM, Yves Parès
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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe