
Dear Andrew and Lee Thanks for your comments. Andrew Wagner wrote:
As for why it actually happens in this case, it's no doubt related to the particular algorithm ghci uses to do the type inference. Interesting. I tried it in hugs and it doesn't happen:
Main> :type safeSecond safeSecond :: [a] -> Maybe a Main> :type tidySecond tidySecond :: [a] -> Maybe a Main> So, it's a property of the ghci interpreter rather than of the language itself. Just out of curiousity, I'd be interested to know what's going on in ghci to produce this effect. Are there different types of type variable? Learning Haskell is reminding me of things I studied when I was an undergrad (linguistics)--- pattern matching in Prolog; the type system reminds me of categorial grammar; we looked at lamda calculus as part of formal semantics. So I'd like to look into this more deeply, if anyone can give me a pointer into the ghci docs. Thanks again Ivan -- ============================================================ Ivan A. Uemlianin Speech Technology Research and Development ivan@llaisdy.com www.llaisdy.com llaisdy.wordpress.com www.linkedin.com/in/ivanuemlianin "Froh, froh! Wie seine Sonnen, seine Sonnen fliegen" (Schiller, Beethoven) ============================================================