[Haskell-beginners] Unmaybe

Mats Rauhala mats.rauhala at gmail.com
Tue May 14 12:29:23 CEST 2013


maybe mempty id

On Tue, May 14, 2013 at 05:21:44PM +0800, Adrian May 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


-- 
Mats Rauhala
MasseR



More information about the Beginners mailing list