[Haskell-cafe] [Maybe Int] sans Nothings

Gregory Crosswhite gcross at phys.washington.edu
Mon May 23 18:32:57 CEST 2011


On 5/23/11 9:29 AM, Max Bolingbroke wrote:
> On 23 May 2011 17:20, michael rice <nowgate at yahoo.com 
> <mailto:nowgate at yahoo.com>> wrote:
>
>     What's the best way to end up with a list composed of only the
>     Just values,
>     no Nothings?
>
> http://haskell.org/hoogle/?hoogle=%3A%3A+%5BMaybe+a%5D+-%3E+%5Ba%5D
>
> Data.Maybe.catMaybes is what you want :-)
>
> Cheers,
> Max
>

On 5/23/11 9:25 AM, Malcolm Wallace wrote:
> On 23 May 2011, at 17:20, michael rice wrote:
>
>> What's the best way to end up with a list composed of only the Just values,
>> no Nothings?
> Go to haskell.org/hoogle
> Type in "[Maybe a] ->  [a]"
> Click on first result.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

On 5/23/11 9:25 AM, Gregory Crosswhite wrote:
> On 5/23/11 9:20 AM, michael rice wrote:
>> What's the best way to end up with a list composed of only the Just 
>> values,
>> no Nothings?
>>
>>
>>
>
> Try catMaybes in Data.Maybe.
>
> Cheers,
> Greg
>

GO TEAM HASKELL!!!

Cheers,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110523/2356fc40/attachment-0001.htm>


More information about the Haskell-Cafe mailing list