[Haskell-beginners] Unmaybe

bucephalus org bucephalus.org at gmail.com
Tue May 14 13:36:19 CEST 2013


Check out this info
http://en.wikibooks.org/wiki/Haskell/Hierarchical_libraries/Maybe


On Tue, May 14, 2013 at 11:21 AM, Adrian May <adrian.alexander.may at gmail.com
> wrote:

> Hi there,
>
> I have a really annoying scrap of code:
>
> unmaybe Nothing = mempty
> unmaybe (Just dia) = dia
>
> It happened because I'm using Diagrams but building my diagram requires
> looking something up in a list using findIndex, which returns Maybe Int.
>
> How do I rid myself of this blotch?
>
> TIA,
> Adrian.
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130514/47806a42/attachment.htm>


More information about the Beginners mailing list