[Haskell-beginners] Maybe a and Maybe t

Ivan Uemlianin ivan at llaisdy.com
Sun May 31 09:37:27 EDT 2009


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 at llaisdy.com
                     www.llaisdy.com
                         llaisdy.wordpress.com
                     www.linkedin.com/in/ivanuemlianin

    "Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
                     (Schiller, Beethoven)
============================================================



More information about the Beginners mailing list