[Haskell-cafe] Do expression definition

Alexander Kotelnikov sacha at myxomop.com
Mon Sep 13 03:21:59 EDT 2010


http://www.haskell.org/onlinereport/exps.html#sect3.14 a obscure (to me) note which says

"As indicated by the translation of do, variables bound by let have fully polymorphic types while those defined by <- are lambda bound and are thus monomorphic."

What actually does it mean?

And, also, would it make any difference if

do {p <- e; stmts}	=	let ok p = do {stmts}
    ok _ = fail "..."
  in e >>= ok

is redefined as "e >>= (\p -> do {stmts})"?

Thanks, Alexander

More information about the Haskell-Cafe mailing list