[Haskell-cafe] Inferred typing?

michael rice nowgate at yahoo.com
Tue May 12 14:08:11 EDT 2009


I was looking at some code and couldn't figure out how it was returning a list since there were no list constructors present.

Thanks!

Michael

--- On Tue, 5/12/09, Brent Yorgey <byorgey at seas.upenn.edu> wrote:

From: Brent Yorgey <byorgey at seas.upenn.edu>
Subject: Re: [Haskell-cafe] Inferred typing?
To: haskell-cafe at haskell.org
Date: Tuesday, May 12, 2009, 7:50 AM

On Mon, May 11, 2009 at 10:59:01PM -0700, michael rice wrote:
> In the code below, is the type returned by the return functions inferred from 
> the result type in the function type signature, i.e., just change the result
> type to Maybe Int and the code will return a Maybe monad, (Just 4), instead of
> a List monad?

Indeed, it is.  Try it! =)

-Brent
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090512/85402a69/attachment.html


More information about the Haskell-Cafe mailing list