On May 10, 2010, at 05:51 , Milind Patil wrote:
There seems to something special about (>>=) apart from its type.
(Monad ((->) b))? I am new to Haskell and I may have gaps in my
type inference in Haskell.
Everyone else having answered the first question, I'll take this one:
((->) r) is the monad of functions with a single argument (and
therefore all functions, as Haskell curries all functions: that is,
"f a b c" is a function which takes an a and returns a function that
takes a b, which in turn produces a function that takes a c and
produces the final result). It's also known as the Reader monad. The
syntax is the function form of the section (r ->) (which I think is
otherwise illegal, since -> is actually syntax rather than an
operator); understand this as a partial application of (r -> x), a
function which takes an r and produces an x.
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@xxxxxxxxx
system administrator [openafs,heimdal,too many hats] allbery@xxxxxxxxxxx
electrical and computer engineering, carnegie mellon university KF8NH
Haskell-Cafe mailing list